SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Broken script or error. Need help

    Just added a little bit more dhtml to a page and then xhtml-ed it.

    Now I'm getting javascript errors in Mac/IE5.1

    Error says...

    Microsoft JScript runtime error:

    Line: 66
    Char: 19
    Error: Invalid procedure call or argument


    That point in the page code was the following line (character 19 onwards in red):

    <div id="studycliplayer" class="studyclip">

    Tweaked the page a little and tried again.

    Same line number (66), same character (19), same error description (Invalid procedure…) though now that line is:

    <table class="content" cellspacing="0" cellpadding="0">.

    Tried a few more times and the error seemed to be stuck on the same line/character regardless of whatever code was actually at that point.
    Most of my attempts had nothing but simple css or table code at that point which surely shouldn't throw up a javascript error.

    Any ideas? Does this seem familiar to anyone?

    TIA
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2002
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you have any exturnal js scripts on the page?, if so they are also counted. So you'll need to paste them in to find the real line num... cause a div/table wont throw a error..

  3. #3
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When I select to see 'source' (a button to do this is available in the javascript error alert box) it invariably opens the html document, goes to line 66 and highlights everything from char 19 till the end of that line.

    This is why I assume it refers to the html page.

    Assuming IE to be a dumb program that will point and blame the wrong document for an error (not too hard to imagine) here is the line from the external js.

    var x,t; if((n.indexOf("?"))>0&&parent.frames.length){t=n.split("?");

    It is a line from the following function which is one that Dreamweaver produces to compliment its image swap function.

    I produced the page (with functions) in Dreamweaver then farmed all the javascript out to an external.
    Until this error all the javascript had been working completely fine.
    Even more confusing is the fact that the js file hasn't even been altered for days.

    I tried swapping around the order of some of the functions while bearing in mind that some functions need to be written in a certain order.

    The line number of the error (as IE claimed) changed, but was not consistant with the moves I had made.

    I had moved the function that included the original line 66 higher up the js file.
    However, after trying it again the error line number changed- to a number further *down* the file (line 72).
    The character number pointed to in the error alert was still 19.

    var i,p,v,obj,ar{gs=MM_showHideLayers.arguments;if(document.getElementById)

    This is part of a show/hide function grabbed from DW extensions repository that had been equally reliable.

    While this strongly suggest that it can't be the fault of whichever function surrounds line 66, the fact of the unchanging character number only confuses me more.

    I am beginning to think that the problem may not be with the javascript at all, but with the browser or its javascript engine.


    Again, if this seems to be more than a case of buggy browser bs (to anyone), then the continued loan of your expertise would be welcome.

    Thanks again.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  4. #4
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's what you have to do:

    Code:
    1. Find your fastest pair of running shoes, put them on.
    
    2. Douse your computer, and anything that has come into contact with the "DreamWeaver" product... in Petrol.
    
    3. Perfom sacred sacrimonial religious rights on the now dripping computer, and pour holy water around the area now soaked in petrol.
    
    4. Light the petrol while saying:
        "I am sorry for using the program of the devil,
         I will endeavour to hand code from hence forth.
         I command you - begone foul Dreamweaver!"
    
    5. Use those running shoes to run from your house or 
       place of employment.
    If you follow these steps properly, you may escape
    the clutches of the satanical Program.

    Disclaimer:
    Nothing i have said here, for the record, should
    in any way suggest that i think Dreamweaver isn't
    a very good product indeed.


    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  5. #5
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lmfao, Flawless your a nutter hehe

  6. #6
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nothing wrong with Dreamweaver.

    (Kind of) tracked down the issue to the XHTML DTD header tag and namespace.

    Took them off and I got my page back. Huzzah!

    I should have known to check this as only recently I helped another member here track down problems with his page.
    The villain then was the XHTML header declaration and namespace too.

    Perhaps it might be a good idea to throw the question as to why they sometimes have this effect open to the HTML/XHTML threads here.


    I've been trying out BBTidy to streamline the XHTML-ising process.
    For the most part it did the job fine and dandy, but on my javascript-heavy main page it fubarred up some of the code even removing two essential divs completely.
    Apparently, it didn't like nested divs and took out the inner div tag thereby 'reallocating' all that div's content to the parent clipping div.
    This meant that my show/hide functions which were calling divs by id were talking to no-one as those divs weren't there anymore.

    Guess I'll go back to hand XHTML-ising until Tidy gets its act together.
    (Still may use it on less complex pages)

    Just like I will still use DW () to put together a page/site and then hand-sift through the code tweaking and pushing out the javascript and css to external files..

    Nothing wrong with that process- nothing wrong at all.

    I appreciate the benefits of being 110% code savvy, but web-design isn't a large enough part of my work to warrant taking time out specifically to bend my head round all the details.
    I've no desire or demand to attain developer-level skills.

    For now, I'll let DW do the donkey work, double-check and externalise all the non-html/xhtml and fill in the gaps of what I would benefit from knowing along the way.

    Thanks for the feedback though.
    I'll be sure to give you a shout the next time I do something that breaks my page and can't decide which piece of software to blame.
    Last edited by Bill Posters; Apr 6, 2002 at 05:30.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature


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
  •