Results 1 to 4 of 4

Thread: help, javascript problem

  1. #1
    Join Date
    Aug 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default help, javascript problem

    I trying to use simple javascript to launch a page into an inline frame. the script I have so far runs thus:

    <script>
    function loadhometitle() {
    frames['titleframe'].location.href='http://www.hotmail.com'; return false;

    }
    </script>



    the event handler being <a onclick="loadhometitle()" ...................



    the problem is that hotmail doesn't load into the iframe but the whole page; or atleast it appears to begin to load into the iframe then simply takes up the whole page.


    I have also tried : parent.frames[titleframe].location = 'http://www.hotmail.com'


    any solutions have to be in javascript

    please help!

    thanks

    Chris

  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

    You don't need a script for that. If the link is on the parent page:
    Code:
    <a href="www.hotmail.com" target="titleframe">Hot Mail</a>
    or, if the link is already in the iframe:
    Code:
    <a href="www.hotmail.com">Hot Mail</a>
    BUT, if hotmail.com has code on their page(s) to break out of frames, there is no method that will prevent that from happening other than turning off javascrpt on your browser.
    - John
    ________________________

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

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

    Default

    Thanks for the reply but I can't use the straight forward <a href= ></a> tags. What i've done on my site is assemble a series of buttons with a special dissolving rollover effect on them, in order to do this I had to specify onmouseover and onmouseout codes, plus these buttons are all hyperlinked. I have tried repeatedly to slip some code into the existing <a> tags but to no avail, in fact the rollover effect even stopped working, thus I need to use javascript and an event handler.


    suggestions please

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

    Default you genius

    no wait...you genius....you were right, the problem is simply because stinking hotmail.com wouldn't stay within the iframe......never use hotmail as a test page :-)

    thanks alot

    chris

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
  •