Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: URL Bar Javascript

  1. #1
    Join Date
    Jun 2006
    Location
    Acton Ontario Canada.
    Posts
    677
    Thanks
    0
    Thanked 1 Time in 1 Post

    Question URL Bar Javascript

    Hello, i need a script that has an input feild and the input is URL's. when a go button is clicked the url open in an inline frame. if you could write in a Back/Forward Script that'd be great.
    PS. if it isnt conceivable please tell me.

  2. #2
    Join Date
    Jun 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by boxxertrumps
    Hello, i need a script that has an input feild and the input is URL's. when a go button is clicked the url open in an inline frame. if you could write in a Back/Forward Script that'd be great.
    PS. if it isnt conceivable please tell me.
    Its doable... at a rough guess (not tested this script)

    HTML Code:
    <input type="text" name="url" id="url">
    <input type="button" onclick="showurl">
    your iframe would be something like this

    HTML Code:
    <iframe name="theiframe" id="theiframe">
    and the Javascript code would look like

    Code:
    function showurl(){
      if (document.getElementById('url').value != ""){
        theiframe.location = document.getElementById('url').value;
      } else {
        alert('No URL Entered');
      }
    }
    for the forward and back i think this will work
    HTML Code:
    <a href="Javascript:;" onclick"theiframe.history(-1);">
    not tested any of that tho going off memory

  3. #3
    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

    Close but, with several errors, try:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
    <html>
    <head>
    <title>Mini Browser</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script type="text/javascript">
    function showurl(){
      if (document.getElementById('url').value != "")
        theiframe.location.href = document.getElementById('url').value;
      else
        alert('No URL Entered');
    }
    </script>
    </head>
    <body>
    <input type="text" id="url"><br>
    <input type="button" onclick="showurl();"><br>
    <iframe name="theiframe"></iframe><br>
    <a href="javascript:void(0);" onclick="history.go(-1);return false;">Back</a>&nbsp;<a href="javascript:void(0);" onclick="history.go(1);return false;">Forward</a>
    </body>
    </html>
    Note: The back link will take you to the previous page in the history stack (if any) if there is nothing to go back to in the iframe. By launching the above page as a new window, that should eliminate that possibility.
    - John
    ________________________

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

  4. #4
    Join Date
    Aug 2005
    Posts
    971
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Searching for something like this??

    Hey try this out: http://captninsano.tripod.com/browser.html

    Recently Updated!!
    (Works in FF 1.5 IE 5-6 but unfortunately not in Opera Has an extra feature{shows history when Ctrl is pressed})

    If you are searching for something like that then I can provide you the code(freely distributable with appropriate credits). If you are not searching for something like that then it's not a problem at all.

  5. #5
    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

    Quote Originally Posted by shachi
    Hey try this out: http://captninsano.tripod.com/browser.html

    Recently Updated!!
    (Works in FF 1.5 IE 5-6 but unfortunately not in Opera Has an extra feature{shows history when Ctrl is pressed})

    If you are searching for something like that then I can provide you the code(freely distributable with appropriate credits). If you are not searching for something like that then it's not a problem at all.
    The stop and refresh buttons can get you into trouble in FF and also cancel the history list feature in that browser. The page jumps from left to right when using the history and individual entries in the history reveal feature do not each have their own line.
    - John
    ________________________

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

  6. #6
    Join Date
    Aug 2005
    Posts
    971
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1
    The stop and refresh buttons can get you into trouble in FF and also cancel the history list feature in that browser. The page jumps from left to right when using the history and individual entries in the history reveal feature do not each have their own line.
    The jumping page was made on purpose(so as to make it look like FF) and by the way I didn't get how can i get into trouble if I use the stop and refresh buttons?? And can you also tell me why "history reveal feature do not each have their own line" I would try to show it in a single line if it is not correct.

  7. #7
    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

    Quote Originally Posted by shachi
    The jumping page was made on purpose(so as to make it look like FF) and by the way I didn't get how can i get into trouble if I use the stop and refresh buttons?? And can you also tell me why "history reveal feature do not each have their own line" I would try to show it in a single line if it is not correct.
    The history lines could probably be fixed easily enough, if you are using an element's innerHTML to write them out, simply by inserting <br> tags after each entry after you append it. A nice touch would be to construct the list in such a way as to make each item a link to itself, with the target being the iframe.

    I would think that Stop and Refresh should either be skipped or work as in a browser. If I hit Stop in the browser and then refresh, the page I was loading reloads and the history remains intact, neither of those happened.

    These things could probably be achieved with (a) session cookie(s).

    With the jumping history, to make it like FF (IE does this too) you could use an iframe or scrolling division (probably best) or frame to contain the history. This would make it more like those browsers are when their history buttons are clicked.

    I realize that when designing something like this that there often is a tendency not to try and 'push the envelope' on the features when testing but, these thing will be done, as a matter of course, by individuals using the design.

    Overall, I should mention that the design looked nice but, with its reliance on javascript and the fact that at best, it merely duplicates what the user has before them to begin with, I wonder about its usefulness. These reservations apply to this thread in general but, it is an interesting exercise.

    I wonder why the OP wanted something like this to begin with.
    - John
    ________________________

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

  8. #8
    Join Date
    Jun 2006
    Location
    Acton Ontario Canada.
    Posts
    677
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default thanks!

    The Internet Does Care... and here's the finished product.
    MY PAGE!

  9. #9
    Join Date
    Jun 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by boxxertrumps
    The Internet Does Care... and here's the finished product.
    MY PAGE!
    Nice glad the JS code worked,... well once it got the bugs taken out lol like i said was coded from memory and didnt have chance to check it over

  10. #10
    Join Date
    Aug 2005
    Posts
    971
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1
    The history lines could probably be fixed easily enough, if you are using an element's innerHTML to write them out, simply by inserting <br> tags after each entry after you append it. A nice touch would be to construct the list in such a way as to make each item a link to itself, with the target being the iframe.

    I would think that Stop and Refresh should either be skipped or work as in a browser. If I hit Stop in the browser and then refresh, the page I was loading reloads and the history remains intact, neither of those happened.

    These things could probably be achieved with (a) session cookie(s).

    With the jumping history, to make it like FF (IE does this too) you could use an iframe or scrolling division (probably best) or frame to contain the history. This would make it more like those browsers are when their history buttons are clicked.

    I realize that when designing something like this that there often is a tendency not to try and 'push the envelope' on the features when testing but, these thing will be done, as a matter of course, by individuals using the design.

    Overall, I should mention that the design looked nice but, with its reliance on javascript and the fact that at best, it merely duplicates what the user has before them to begin with, I wonder about its usefulness. These reservations apply to this thread in general but, it is an interesting exercise.

    I wonder why the OP wanted something like this to begin with.
    It was just made as an experiment(you know it as you helped me making it) not in a way to give some facilities to people(because I knew that people would already have a browser to see one like that). And I still don't know how to make cookies(as I am just a beginner). But anyways if you wish then you can make some changes in it too.

    If you wish

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
  •