Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Regular Coder
    Join Date
    Dec 2003
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Multiple Javascripts ("Done, but with errors on page")

    I just added a new javascript to my page:

    http://www.pianomanfan.com/footer.ssi

    I am getting the "Done, but with errors on page" in my status bar. Could this be from having multiple javascripts on the page?

    Please help...


    Thanks!
    Dan

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    the error says it is around line 130


    that is where you have some bookmark - status thing script
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    Regular Coder
    Join Date
    Dec 2003
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Yes...?

    Yes, it is a new bookmarking script that bookmarks the actual page. Can you help fix the following code - thanks!?!?!?!?!?!

    <script language="JavaScript">

    <!--

    // message to show in non-IE browsers
    var txt = "Bookmark This Page!!!"
    // do not edit below this line
    // ===========================

    var url = this.location;
    var who = document.title;
    var ver = navigator.appName
    var num = parseInt(navigator.appVersion)
    if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
    document.write('<A HREF="javascript:window.external.AddFavorite(url,who);" ');
    document.write('onMouseOver=" window.status=')
    document.write("txt; return true ")
    document.write('"onMouseOut=" window.status=')
    document.write("' '; return true ")
    document.write('<a href="http://www.PianoManFan.com/Bookmark.html"><img name="Bookmark" src="http://www.PianoManFan.com/BookmarkButton.gif" width="158" height="37" border="0" alt=""></a>')
    }else{
    txt += " (Ctrl+D)"
    document.write(txt)
    }

    //-->
    </script>


    THANKS!
    Dan

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    The bookmarking script seems fine. Mozilla is giving me a error on the following (age calculation) script. You've got this:
    Code:
    countup(2003,05,09)
    ...and the leading zeroes on the date & month numbers are causing them to be interpreted as octal (base-eight) numbers. Try it without the '0'.

  • #5
    Regular Coder
    Join Date
    Dec 2003
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Nope

    I still got errors...

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Atlanta, GA.
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There is nothing wrong with the javascript as such.
    What is happening is you are writing garbage HTML into the document. The HTML has invalid onMouseOver/Out JavaScript code that is terminated incorrectly.

    Your javascript is correct, the code it generates is causing the JavaScript Error.

    Take a look at what you are trying to write out.

    Code:
    <A HREF="javascript:window.external.AddFavorite(url,who);" onMouseOver=" window.status=txt; return true "onMouseOut=" window.status=' '; return true <a href="http://www.PianoManFan.com/Bookmark.html"><img name="Bookmark" src="http://www.PianoManFan.com/BookmarkButton.gif" width="158" height="37" border="0" alt=""></a>

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Scrap the bookmarking script and link. It just wastes space on your page because anyone who finds your page compelling enough is going to bookmark it anyway. You're wasting your time and effort duplicating things that the browser window interface already provides.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #8
    Regular Coder
    Join Date
    Dec 2003
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Roy...

    Roy, how can I fix it?

    THANKS!

  • #9
    Regular Coder
    Join Date
    Jun 2002
    Location
    Atlanta, GA.
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <!--
    // message to show in non-IE browsers
    var txt = "Bookmark This Page!!!"
    // do not edit below this line
    // ===========================
    var url = this.location;
    var who = document.title;
    var ver = navigator.appName
    var num = parseInt(navigator.appVersion)
    if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
       document.write('<A HREF="javascript:window.external.AddFavorite(url,who);" ');
       document.write('onMouseOver="window.status=')
       document.write("txt; return true")
       document.write('" onMouseOut="window.status=')
       document.write("' '; return true")
       document.write('"><img name="Bookmark" src="http://www.PianoManFan.com/BookmarkButton.gif" width="158" height="37" border="0" alt=""></a>')
    }else{
       txt += "  (Ctrl+D)"
       document.write(txt)
    } 
    //-->
    The answer does not come from thinking outside the box, it comes from realizing the truth :-
    "There Is No Box". [JavaScript Gadgets'n'Gizmos][JavaScript-FX]

  • #10
    Regular Coder
    Join Date
    Dec 2003
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks

    OK, the error went away, but when clicking the bookmark link, it did not allow me to add a favorite, rather, it linked to this page:

    http://www.pianomanfan.com/java%20sc...al.AddFavorite(url,who);

    (I put the code back to what it was.)


    THANKS!!!!!!!

  • #11
    Regular Coder
    Join Date
    Jun 2002
    Location
    Atlanta, GA.
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts
    document.write('<A HREF="javascript:window.external.AddFavorite(url,who);" ');

    Should be all one word. No spaces. this forum splits it up. Make sure it is all one word. javascript
    The answer does not come from thinking outside the box, it comes from realizing the truth :-
    "There Is No Box". [JavaScript Gadgets'n'Gizmos][JavaScript-FX]

  • #12
    Regular Coder
    Join Date
    Dec 2003
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That is exactly what I have...

  • #13
    Regular Coder
    Join Date
    Jun 2002
    Location
    Atlanta, GA.
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Are you sure?.
    When I tested it it worked fine. (I always test before I post any code.)

    The URL you posted as the result of the script had a space in it.

    I just cut and paste the script from this thread into a notepad document and when I tested it gave this result

    http://www.pianomanfan.com/java%20sc...al.AddFavorite

    Which is what you say you got.

    I then edited the code and made sure that the word javascript was all one word and it worked fine.


    Can you set up a test page?
    The answer does not come from thinking outside the box, it comes from realizing the truth :-
    "There Is No Box". [JavaScript Gadgets'n'Gizmos][JavaScript-FX]

  • #14
    Regular Coder
    Join Date
    Dec 2003
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool

    BRILLIANT!!!

    I did a spot check on about 10 pages, all were good, but this one:

    http://www.pianomanfan.com/Albums.shtml

    Any ideas?

  • #15
    Regular Coder
    Join Date
    Jun 2002
    Location
    Atlanta, GA.
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, I know what is wrong. Unfortunately I have just noticed I shouldn't be helping you at all.

    Please see this (No 2 )
    http://www.dynamicdrive.com/notice.htm

    Fix this error on all your pages and I will help fix your page

    Please respect the work of others.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •