ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Javascript works when running in template, but not when adding weblog entry?

April 19, 2011 8:13pm

Subscribe [1]
  • #1 / Apr 19, 2011 8:13pm

    threeplusone

    1 posts

    Hi

    I am really struggling with this. I am pretty new to this but will do what I can to make myself clear.

    I am using some javascript that modifies the look of the scroll bar within the page, allowing me to scroll through more text in a smaller area.

    When viewing all the entries in the main template ‘work’, the javascript works fine, but when I click on an individual weblog entry to view it on its own separate page and extended url, the javascript doesn’t function anymore. Can anyone explain what is happening here and how I might solve it?

    To clarify:

    Basically the url http://www.mydomain.com/work displays the weblog entries with javascript o.k.
    When clicking to view one article from this page but viewed on its own page, with its own url such as http://www.mydomain.com/work/article, it doesn’t run the javascript anymore??

    Article is only a weblog entry and hasn’t got its own template, could this be my problem?

    Sorry if this is obvious, but I have spent 4 days trying to work this out, forums, and web, no luck.

    Thanks

  • #2 / Apr 19, 2011 9:49pm

    threeplusone

    1 posts

    O.k

    I have fixed the problem, at last. Actually writing out the question on here made me look at it again with slightly more focused eyes.

    I just compared my problem to another site I worked on, as I have not had this problem before and just couldn’t see what I had done wrong this time.

    Really strange I just couldn’t see it.

    Anyway…I needed to put the javascript on the server as it didn’t work as template, and had to use a full path absolute path to find it, seems it wasn’t finding it correctly previously with shorter paths i used.

    Anyway, my horlicks is kicking in, and time for sleep, early morning to catch up on the days I have lost 😊

    Thanks,

    😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases