Options

Code errors on page, help me troubleshoot please!

Grimdeath9740Grimdeath9740 Registered Users Posts: 7 Beginner grinner
edited December 30, 2005 in SmugMug Support
Im a cut and paste kinda guy so ive run into a couple errors on my pages. everythings working ok but if anyone can help me revise the sections of codes that are "bad" it would be much appreciated. Heres the site:

http://www.gordon-photography.smugmug.com

*edit*
btw these are only in IE, firefox is working great.

Comments

  • Options
    AndyAndy Registered Users Posts: 50,016 Major grins
    edited December 30, 2005
    Is there a reason why you have javascript in your HEAD section of customization?
    <td><script language=JavaScript>
    <!--
    
    //Disable right click script III- By Renigade (renigade@mediaone.net)
    //For full source code, visit http://www.dynamicdrive.com
    
    var message="";
    ///////////////////////////////////
    function clickIE() {if (document.all) {(message);return false;}}
    function clickNS(e) {if 
    (document.layers||(document.getElementById&&!document.all)) {
    if (e.which==2||e.which==3) {(message);return false;}}}
    if (document.layers) 
    {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
    else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
    
    document.oncontextmenu=new Function("return false")
    
    document.oncontextmenu=function(){return false;}
    // --> 
    </script></td>
    
    <META HTTP-EQUIV="imagetoolbar" CONTENT="no">
    
  • Options
    AndyAndy Registered Users Posts: 50,016 Major grins
    edited December 30, 2005
    Im a cut and paste kinda guy so ive run into a couple errors on my pages. everythings working ok but if anyone can help me revise the sections of codes that are "bad" it would be much appreciated. Heres the site:

    http://www.gordon-photography.smugmug.com

    *edit*
    btw these are only in IE, firefox is working great.

    I'm looking at your page in IE, what errors are you seeing? Screen grabs help a lot thumb.gif
  • Options
    Grimdeath9740Grimdeath9740 Registered Users Posts: 7 Beginner grinner
    edited December 30, 2005
    http://www.java-scripts.net/javascripts/Right-Click-Block.phtml

    the second part of that script says to go into the body section, but the body section i see under smugmug's customization page is only one line long...i experimented and well, it worked so i went with it....LMK where i SHOULD put it. thanks for the super quick responce!
  • Options
    AndyAndy Registered Users Posts: 50,016 Major grins
    edited December 30, 2005
    http://www.java-scripts.net/javascripts/Right-Click-Block.phtml

    the second part of that script says to go into the body section, but the body section i see under smugmug's customization page is only one line long...i experimented and well, it worked so i went with it....LMK where i SHOULD put it. thanks for the super quick responce!

    I can't tell you but one of the javascripters will be along, I'm sure... standby...
  • Options
    flyingdutchieflyingdutchie Registered Users Posts: 1,286 Major grins
    edited December 30, 2005
    http://www.java-scripts.net/javascripts/Right-Click-Block.phtml

    the second part of that script says to go into the body section, but the body section i see under smugmug's customization page is only one line long...i experimented and well, it worked so i went with it....LMK where i SHOULD put it. thanks for the super quick responce!

    It works as it is right now: right-clicking does not work, and this is what you want. And i see no javascript errors at all :)

    You may want to put it into your 'javascript' section of your customization instead, but without the <script language=JavaScript><!-- and --></script> elements! If you do this correctly, it should work as it is now.
    I can't grasp the notion of time.

    When I hear the earth will melt into the sun,
    in two billion years,
    all I can think is:
        "Will that be on a Monday?"
    ==========================
    http://www.streetsofboston.com
    http://blog.antonspaans.com
  • Options
    Grimdeath9740Grimdeath9740 Registered Users Posts: 7 Beginner grinner
    edited December 30, 2005
    alright, ill try it out, thanks!

    *edit*
    meh, nah that doesnt work. the script is in two sections and one section IS in the javascript section, both together doesnt seem to work. If all else fails ill leave it as is(working)
  • Options
    flyingdutchieflyingdutchie Registered Users Posts: 1,286 Major grins
    edited December 30, 2005
    alright, ill try it out, thanks!
    Kewl, :D
    So only put this into the 'javascript' field of your customization:
    //Disable right click script III- By Renigade ([EMAIL="renigade@mediaone.net"]renigade@mediaone.net[/EMAIL])
    //For full source code, visit [URL="http://www.dynamicdrive.com"]http://www.dynamicdrive.com[/URL]
    var message="";
    ///////////////////////////////////
    function clickIE() {if (document.all) {(message);return false;}}
    function clickNS(e) {if 
    (document.layers||(document.getElementById&&!document.all)) {
    if (e.which==2||e.which==3) {(message);return false;}}}
    if (document.layers) 
    {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
    else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
    
    
    And remove it from your 'Head tag' section.
    I can't grasp the notion of time.

    When I hear the earth will melt into the sun,
    in two billion years,
    all I can think is:
        "Will that be on a Monday?"
    ==========================
    http://www.streetsofboston.com
    http://blog.antonspaans.com
  • Options
    flyingdutchieflyingdutchie Registered Users Posts: 1,286 Major grins
    edited December 30, 2005
    alright, ill try it out, thanks!

    *edit*
    meh, nah that doesnt work. the script is in two sections and one section IS in the javascript section, both together doesnt seem to work. If all else fails ill leave it as is(working)

    If you have galleries with 'protected' images, the javascript you use may not work or the protection mechanism may fail. If you don't have protected images, don't worry and ignore this post.
    I can't grasp the notion of time.

    When I hear the earth will melt into the sun,
    in two billion years,
    all I can think is:
        "Will that be on a Monday?"
    ==========================
    http://www.streetsofboston.com
    http://blog.antonspaans.com
  • Options
    flyingdutchieflyingdutchie Registered Users Posts: 1,286 Major grins
    edited December 30, 2005
    alright, ill try it out, thanks!

    *edit*
    meh, nah that doesnt work. the script is in two sections and one section IS in the javascript section, both together doesnt seem to work. If all else fails ill leave it as is(working)

    Just try to add these two lines at the bottom of your javascript section:
    document.oncontextmenu=new Function("return false")
    document.oncontextmenu=function(){return false;}
    If this does not work either, leave it alone and go back to your original working version.

    However, be sure that you don't have <td> and </td> elements in your script! I saw these in your page's source.

    EDIT: Actually, i just examined your script a bit more, you can replace all this script with just one statement and put this in your javascript section:
    document.oncontextmenu=new Function("return false");
    That's it :)
    I can't grasp the notion of time.

    When I hear the earth will melt into the sun,
    in two billion years,
    all I can think is:
        "Will that be on a Monday?"
    ==========================
    http://www.streetsofboston.com
    http://blog.antonspaans.com
Sign In or Register to comment.