Welcome to TalkGraphics.com
Page 1 of 3 123 LastLast
Results 1 to 10 of 28
  1. #1

    Question How to construct URL that calls javascript and loads .html file

    Hi,

    does anyone know how to create an URL string (Web properties/Link tab/Link to web address -field) that would run Covoxer's myOpen/Close script and simultaneously load a .html file to a iFrame that sits on a popup layer which is shown by Covoxer's script?

    I know that the iFrame has to be uniquely named so that it can be targeted in the URL, but the rest is beyond me.

  2. #2
    Join Date
    Aug 2004
    Location
    Ukraine
    Posts
    3,904

    Default Re: How to construct URL that calls javascript and loads .html file

    It may look like this:
    Code:
    javascript:document.getElementById("iframename").src="newurl";my_open("popup")
    where:
    iframename - iframe ID (set as: <iframe id="iframename"></iframe>);
    newurl - link to the file that has to be open in iframe;
    popup - popup to open (for Locking popups tweak).

    The "The Open link in" feld in the Link tab has to be set to "Not specified" or "Same frame".
    John.

  3. #3

    Default Re: How to construct URL that calls javascript and loads .html file

    Well looking at that it is no wonder I couldn't make that on my own.

    Thanks John!

  4. #4

    Default Re: How to construct URL that calls javascript and loads .html file

    Sorry John, I have to ask this...

    Is it possible to add regular my_open/_close javascript calls in addition to the example you provided? In other words the link should do the main thing which is open popup layer, load URL into iFrame, and at the same time open/close a few popup layers.

  5. #5
    Join Date
    Aug 2004
    Location
    Ukraine
    Posts
    3,904

    Default Re: How to construct URL that calls javascript and loads .html file

    Yes you can. Separate them with semicolons as usually.
    John.

  6. #6
    Join Date
    Aug 2000
    Location
    Prince Edward Island, Canada --- The land of lawn tractors
    Posts
    5,389

    Default Re: How to construct URL that calls javascript and loads .html file

    Quote Originally Posted by covoxer View Post
    Yes you can. Separate them with semicolons as usually.
    Sorry but if anone could post some more sample code it would be very helpful to all the javascript noobies like me. The ealier post above (post #2) was great and I could follow that. Hopefully somebody can create a similar post showing it plus the part that would close those other popups that Markku notes.

    Regards, Ross

  7. #7
    Join Date
    Aug 2004
    Location
    Ukraine
    Posts
    3,904

    Default Re: How to construct URL that calls javascript and loads .html file

    Ok. Here's the one that loads page1.htm to the iframe, closes "popup1" and "popup3" and opens "popup2" and "popup4":
    Code:
    javascript:document.getElementById("iframename").src="page1.htm";my_close("popup1");my_close("popup3");my_open("popup2");my_open("popup4")
    As you see, all the commands like "my_open("popup2")" are separated with semicolons.
    You can also add any other JS statements in the same manner. Fo example, following will load iframe, open popup and show you a message:
    Code:
    javascript:document.getElementById("iframename").src="page1.htm";my_open("popup2");alert("Well done!!!")
    Also note that commands are excuted in the order they are added to this string.
    John.

  8. #8

    Default Re: How to construct URL that calls javascript and loads .html file

    Could be my mistake again, but I cannot get this to work with IE7.

    Should it?

  9. #9
    Join Date
    Aug 2004
    Location
    Ukraine
    Posts
    3,904

    Default Re: How to construct URL that calls javascript and loads .html file

    Quote Originally Posted by Markku View Post
    Could be my mistake again, but I cannot get this to work with IE7.
    Should it?
    What exactly doesn't work? Does iframe change it's content? Do popups open/close? Or nothing happens at all?... Or error message pops up?
    John.

  10. #10

    Default Re: How to construct URL that calls javascript and loads .html file

    Too little information on my behalf, sorry.

    The iFrame does not load the .htm file. The popup works fine.

 

 

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
  •