Results 1 to 6 of 6

Thread: Having Trouble w/ Iframe SSI script II

  1. #1
    Join Date
    Jul 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Having Trouble w/ Iframe SSI script II

    1) Script Title:
    Iframe SSI script II

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...iframessi2.htm

    3) Describe problem:

    I can't seem to get this script to work.

    I have Iframe working fine, but this script doesn't seem to want to play nicely. Could someone please take a look at my source code and tell me what -- if anything -- I'm doing incorrectly. I've been playing with it for hours now and can't figure it out.

    My site:

    http://206.246.118.129/forum.php

    ***Note: I changed the style to display and removed height="0" to make it easier for me to troubleshoot, but the script didn't work even when I had it configured *exactly* like the example.

    I've tried lots of little changes to the <iframe> configuration, ensured that my hostname/DNS is all working correctly, and removed other javascript functionality that might be causing a conflict.

    Thanks in advance for the assistance!

  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

    To start with, reinstall the script making sure all line breaks remain intact.
    - John
    ________________________

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

  3. #3
    Join Date
    Jul 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Okay, I changed it.

    Honestly I don't know why it does that as the line breaks are there as I see the special characters...sometimes I have to cut-and-paste from one text editor to another. I use Dreamweaver by default. Eh.

    Unfortunately it still doesn't work, even if it does read more clearly.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Yes, but now we can actually read it
    Code:
    function loadintoIframe(iframeid, url){
    if (document.getElementById)
    document.getElementById(iframeid).src=url
    {
    
    if (window.addEventListener)
    window.addEventListener("load", resizeCaller, false)
    else if (window.attachEvent)
    window.attachEvent("onload", resizeCaller)
    else
    window.onload=resizeCaller
    
    </script>
    A lot of the script has been chopped off at some point.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  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

    Whatever you are using, somehow you have managed to reverse two of the function defining brackets (highlighted red):

    Code:
    function readjustIframe(loadevt) {
    var crossevt=(window.event)? event : loadevt
    var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
    if (iframeroot)
    resizeIframe(iframeroot.id);
    {
    
    function loadintoIframe(iframeid, url){
    if (document.getElementById)
    document.getElementById(iframeid).src=url
    {
    Both of these should be }, not {.

    There could be other problems. But without fixing those, it can never work.

    Also, just for your information, if a script is written out with strict syntax, line breaks usually can be eliminated. However, since the semicolon is often implied by a line break, if it is not there and that line break is removed, you've got trouble. Just putting semicolons at the end of all lines first is not an option, as many line breaks do not imply a semicolon. Knowledge of correct syntax is required to alter a script to be written with no line breaks.

    More: You might want to look into validating your markup and testing its appearance in at least one standards compliant browser like FireFox.
    - John
    ________________________

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

  6. #6
    Join Date
    Jul 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Gentlemen,

    Thank you. A TON! (or is that tonne?)

    Anyway, it worked.

    The first time around I know that those braces were the correct way because I checked and double-checked them, but after you mentioned to get the lines breaks right I went and did a cut-and-paste from this website again. Because I'm using SMARTY templates I actually have to replace the braces with a {ldelim} for the '{' and a {rdelim} for the '}' so I messed it up the second time around.

    The first time I'm pretty sure the problem was the line break issue because the delimeters were correct.

    The only reason I am documenting my stupidity and bad attention to detail is for future readers who may make both of these mistakes.

    Thanks again for your assistance. I appreciate it greatly!

    Warmest regards,

    ~Alec

    P.S. I'll definitely look into the validation more. Thanks for the tip.

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
  •