Results 1 to 2 of 2

Thread: Code to split screen in web browser

  1. #1
    Join Date
    Sep 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Code to split screen in web browser

    I am trying to put some code together that will split a screen into 3 parts, I've borrowed code from a bookmarklet that splits it into 2 frames after getting the URL's from the user.
    I've gotten the code to ask for the 3rd frame URL but it won't fill the frame up with the website. The first code listed is the original code:

    Code:
    javascript:ABC=location.href;DEF=prompt('Choose%20File%201',ABC);     GHI=prompt('Choose%20File%202',DEF);if(L3f7&&R1Gh7){Fr4Q='<frameset%20rows=\'*,*\'>\n<frame%20src=\''+L3f7+'\'/>';Fr4Q+='<frame%20src=\''+R1Gh7+'\'/>\n';Fr4Q+='</frameset>';with(document){write(Fr4Q);void(close())}}else{void(null)}
    Here is the code I've worked on:

    Code:
    javascript:ABC=location.href;DEF=prompt('Choose%20File%201',ABC);GHI=prompt('Choose%20File%202',DEF);JKL=prompt('Choose%20File%203',GHI);if(DEF&&GHI){Fr4Q='<frameset%20rows=\'33%,33%,33%\'>\n<frame%20src=\''+DEF+'\'/>';Fr4Q+='<frame%20src=\''+GHI+'\'/>\n';Fr4Q+='</frameset>';with(document){write(Fr4Q);void(close())}}else{void(null)}
    Now the problem so far is when I try to put in some code to declare the frame src for the 3rd frame the whole thing won't work (no prompts appear) Same thing if I try to rename Fr4Q and Fr4Q+. Not being very good with javascript is hurting my ability to debug this properly, any help would be greatly appreciated for I need this for a work project.
    Thanks
    Bob

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Hmm, what browser(s) are you trying this with?

    Many browsers will not allow code like this to run. They either don't understand it, or think it's a security risk.

    Opera and Chrome seemed fine with it though. In them:

    Code:
    javascript:
    ABC=location.href;
    DEF=prompt('Choose File 1',ABC);
    GHI=prompt('Choose File 2',DEF);
    JKL=prompt('Choose File 3',GHI);
    if(DEF&&GHI&&JKL){
    	Fr4Q='<frameset rows=\'33%,33%,33%\'>\n<frame src=\''+DEF+'\'/>';
    	Fr4Q+='<frame src=\''+GHI+'\'/>\n';
    	Fr4Q+='<frame src=\''+JKL+'\'/>\n';
    	Fr4Q+='</frameset>';
    	with(document){write(Fr4Q);void(close())}
    }else{void(null)}
    works fine.

    Why would you need to do this anyway? Perhaps there's a better way to achieve what you're after. Does it have to be a bookmarklet?

    As a side note, it's not Fr4Q and Fr4Q+, it's just Fr4Q. The operator += means plus equals - the thing = the thing and what follows, basically it means to concatenate.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. User Adjustable Split Screen
    By Sandhya Gade in forum JavaScript
    Replies: 1
    Last Post: 02-21-2009, 09:38 PM
  2. Split screen!
    By neo_philiac in forum Flash
    Replies: 13
    Last Post: 04-24-2008, 07:15 PM
  3. User-adjustable split screen
    By eredin in forum Submit a DHTML or CSS code
    Replies: 8
    Last Post: 04-10-2008, 06:30 AM
  4. A/B Split Testing code? --
    By -- TW in forum Looking for such a script or service
    Replies: 19
    Last Post: 08-20-2007, 05:30 PM
  5. Help - Code discrepency - Full Screen code
    By kurson in forum Dynamic Drive scripts help
    Replies: 17
    Last Post: 05-23-2006, 05:21 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •