Having trouble linking .js script in customizations

aciurczakaciurczak Registered Users Posts: 16 Big grins
edited September 22, 2005 in SmugMug Support
I have a simple array that I use for my header. It works fine if I cut and past the whole large script with function in. On my other sites it works fine if I link to the script and use a src= field.

But on the javascript section of the smugmug site, it closes the tag with a > before the src=, so it does not work.

In other words, all I am putting in the box is this:
src="http://www.montgomerybikers.com/forums/clientscript/picturearray.js"

smugmug then inserts it in the page like this:
<script language="javascript" type="text/javascript">
 src="http://www.montgomerybikers.com/forums/clientscript/picturearray.js" 
               </script>

and since there is a > after the type, it doesn't load the src. Any suggestions?

Comments

  • flyingdutchieflyingdutchie Registered Users Posts: 1,286 Major grins
    edited September 22, 2005
    aciurczak wrote:
    I have a simple array that I use for my header. It works fine if I cut and past the whole large script with function in. On my other sites it works fine if I link to the script and use a src= field.

    But on the javascript section of the smugmug site, it closes the tag with a > before the src=, so it does not work.

    In other words, all I am putting in the box is this:
    src="http://www.montgomerybikers.com/forums/clientscript/picturearray.js"
    

    smugmug then inserts it in the page like this:
    <script language="javascript" type="text/javascript">
    src="http://www.montgomerybikers.com/forums/clientscript/picturearray.js" 
    </script>
    

    and since there is a > after the type, it doesn't load the src. Any suggestions?
    It should be this:
    </script>
    <script language="javascript" type="text/javascript"
    src="http://www.montgomerybikers.com/forums/clientscript/picturearray.js">
    </script>
    <script language="javascript">
    

    And put this in your 'JavaScript HTML>' field of your customization page!
    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
  • aciurczakaciurczak Registered Users Posts: 16 Big grins
    edited September 22, 2005
    It should be this... a very small but important difference! :):
    <script language="javascript" type="text/javascript"
    src="http://www.montgomerybikers.com/forums/clientscript/picturearray.js">
    </script>
    

    I think that's exactly the point. I want it to be what you (and I) posted, but it isn't going to happen, as smugmug inserts this phrase, with the closing > before it inserts any code that you put in the text box:
    <script language="javascript" type="text/javascript">
    

    <img src="https://us.v-cdn.net/6029383/emoji/ne_nau.gif&quot; border="0" alt="" >
  • flyingdutchieflyingdutchie Registered Users Posts: 1,286 Major grins
    edited September 22, 2005
    aciurczak wrote:
    I think that's exactly the point. I want it to be what you (and I) posted, but it isn't going to happen, as smugmug inserts this phrase, with the closing > before it inserts any code that you put in the text box:
    <script language="javascript" type="text/javascript">
    

    <img src="https://us.v-cdn.net/6029383/emoji/ne_nau.gif&quot; border="0" alt="" >
    Made a typo in my previous message. I edited my previous message with the correction. Sorry ... :)
    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
  • {JT}{JT} Registered Users Posts: 1,016 Major grins
    edited September 22, 2005
    And put this in your 'body tag' field of your customization page!

    NO NO NO NO NO :)

    The body tag of the customization field is for only one thing ... the BODY tag! Nothing else should ever go in there. Right now we parse and add things to the body tag, like extra classes and onload javascripts, so if there is not a body tag to do that to, things will break (and badly).

    The correct spot to put linked javascripts is in the header or footer area of the site; just add in this:
    <script language="javascript" type="text/javascript" src="http://www.montgomerybikers.com/forums/clientscript/picturearray.js"></script&gt; Along with any other code you have for the header or footer.
  • flyingdutchieflyingdutchie Registered Users Posts: 1,286 Major grins
    edited September 22, 2005
    {JT} wrote:
    NO NO NO NO NO :)

    The body tag of the customization field is for only one thing ... the BODY tag! Nothing else should ever go in there. Right now we parse and add things to the body tag, like extra classes and onload javascripts, so if there is not a body tag to do that to, things will break (and badly).

    The correct spot to put linked javascripts is in the header or footer area of the site; just add in this:
    <script language="javascript" type="text/javascript" src="http://www.montgomerybikers.com/forums/clientscript/picturearray.js"></script&gt; Along with any other code you have for the header or footer.
    Man man man... i'm getting blind!!!!! I guess it's been a long day! :)
    I meant the 'JavaScript HTML>' field!! That's where i have the script inclusions. Sorry again!

    Thanks for pointing it out, JT!<img src="https://us.v-cdn.net/6029383/emoji/thumb.gif&quot; border="0" alt="" >
    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
  • aciurczakaciurczak Registered Users Posts: 16 Big grins
    edited September 22, 2005
    Man man man... i'm getting blind!!!!! I guess it's been a long day! :)
    I meant the 'JavaScript HTML>' field!! That's where i have the script inclusions. Sorry again!

    I put the original code right at the top of the header, and it worked like a charm. I thought I needed to put it within the "javascript" section, but as we're putting the script tags in anyway, I guess that's not necessary. Thanks for both of your help!

    Site is at: http://www.smugmug.com/community/MSMC if you want to see the working code. Thanks again!
Sign In or Register to comment.