SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Feb 2002
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Javascript/Jscript problem !?!?!?

    Hi all,

    The problem occures because of browser-incompatibility. I wrote an application using Javascript and PHP (php is of no relevance here 'cause the problem is in Javascript) - and all the time i was working i used Opera borwser for testing and when i got it done i tried starting it in IE6.0 and i saw almost nothing !!?!?!

    As you can see if you click H E R E(this is a simple example) - try clicking on the text in the select field in the upper frame and then (in Opera and probably some other browsers) in the down-right frame it should load a web-site of some kind.

    You can see a source code yourself and maybe somebody can tell me why can't Iexplorer do that !?

    I don't think that Javascript and JScript objects are so different (location object, select, frames object ...)?

    Can anyone help me ?!

  2. #2
    SitePoint Guru dale_burrell's Avatar
    Join Date
    Aug 2002
    Location
    Wellington, New Zealand
    Posts
    861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    window.parent.frameName.document.URL =

    was the code I used that was compatable with both IE & NS.

    I've never tried it using the frames collection, but I assume it should work. Still you may want to try using a framename.

    Also the onClick event handler doesn't work for me in an option tag. Not sure what the spec says.

    If that turns out to be the problem you could use an event of the select tag.
    If you aren't living life on the edge
    - you're taking up too much space
    Creative Dreaming Ltd / Ask The Local / Amanzi Travel

  3. #3
    SitePoint Member
    Join Date
    Feb 2002
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by dale_burrell
    window.parent.frameName.document.URL =

    was the code I used that was compatable with both IE & NS.



    I've just tried this and now it doesn't work in Opera as well as IE - it would really hewlp me if you could post asome code - i've used 'parent.rightFrame.document.URL' - is this correct syntax !?

    (frame name is 'rightFrame')

    I've never tried it using the frames collection, but I assume it should work. Still you may want to try using a framename.

    Also the onClick event handler doesn't work for me in an option tag. Not sure what the spec says.

    If that turns out to be the problem you could use an event of the select tag.
    Yes that's it - thanks very much - funny it didn't occure to me at all.

    Thanks again !

  4. #4
    SitePoint Member
    Join Date
    Feb 2002
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Look - i just tried to do what you told me to but i just can't make it work - can you (or anybody else) make that simple example work and upload it somewhere or post a code here so i can see ?!

    It doesn't work because each of the option fields has to have some value transfered to that downframe (because of the php background application i need to have a variable passed on to that frame)

    Now - how do i do that ?!

    I thought of a form but how can i make it work so that when i click on a option field it reloads down frame (rightframe) with a variable (php or any) which i, than, can access through a script in that frame ?!

    I hope you understood what i tried to say !
    Last edited by CorpseEater; Nov 28, 2002 at 14:01.

  5. #5
    SitePoint Guru dale_burrell's Avatar
    Join Date
    Aug 2002
    Location
    Wellington, New Zealand
    Posts
    861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body bgcolor="#FFFFFF" text="#000000">
    <form name="form1" method="post" action="">
    <p>
    <select name="select" size="5" onChange="javascript: parent.frames[2].location.href='http://www.cnn.com';">
    <option>Click here and look at the frame below</option>
    </select>
    </p>
    </form>
    </body>
    </html>
    If you aren't living life on the edge
    - you're taking up too much space
    Creative Dreaming Ltd / Ask The Local / Amanzi Travel

  6. #6
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    PHP Code:
    <head>
    <
    title>Untitled Document</title>
    <
    meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </
    head>

    <
    body bgcolor="#FFFFFF" text="#000000">
    <
    form name="form1" method="post" action="">
    <
    p>
    <
    select name="select" size="5" onChange="parent.frames[2].location.href='http://www.cnn.com';">
    <
    option>Click here and look at the frame below</option>
    </
    select>
    </
    p>
    </
    form>
    </
    body>
    </
    html


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
  •