0
Welcome Guest! Login
0 items Join Now

Loading JS file on demand

    • shenk's Avatar
    • shenk
    • Hero Rocketeer
    • Posts: 424
    • Thanks: 11

    Loading JS file on demand

    Posted 9 years 2 days ago
    • Sometimes I want JS codes being loaded only on some of my pages, how to do this?
      I've tried an extension called addCustomJavascript, but it seems not working with gantry. (As instructed, I loaded its module to the same position as the module that needs the JS code. But when I inspect DOM, its module is not loaded at all.)
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13481
    • Web Designer/Developer

    Re: Loading JS file on demand

    Posted 9 years 2 days ago
    • You will need an extension that capable of doing this so you'll have to look on JED. Make sure your editor is not wiping out any code you are adding too (check it's settings or use our rokpad editor).

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • shenk's Avatar
    • shenk
    • Hero Rocketeer
    • Posts: 424
    • Thanks: 11

    Re: Loading JS file on demand

    Posted 9 years 2 days ago
    • I'm using Rokpad
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13481
    • Web Designer/Developer

    Re: Loading JS file on demand

    Posted 9 years 2 days ago
    • MrT wrote:
      You will need an extension that capable of doing this so you'll have to look on JED.

      Ok, I only said to check and you've done that so now you'll have to look on JED for your sophisiticated load on demand functionality.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • shenk's Avatar
    • shenk
    • Hero Rocketeer
    • Posts: 424
    • Thanks: 11

    Re: Loading JS file on demand

    Posted 9 years 1 day ago
    • Actually that's kind of the thing I want to ask. I have tried some extension but none of them works, so I'm asking for advice about picking a good extension that is capable of doing this.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13481
    • Web Designer/Developer

    Re: Loading JS file on demand

    Posted 9 years 1 day ago
    • Sorry but I don't know of any capable of that. That's a pretty specialist request - and no one has ever asked that in the forum before. You must have something pretty unique about your website that drives that requirement.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • shenk's Avatar
    • shenk
    • Hero Rocketeer
    • Posts: 424
    • Thanks: 11

    Re: Loading JS file on demand

    Posted 9 years 1 day ago
    • I think this shouldn't be a very rare request. I've some slideshow powered by JS, this slideshow only appears on my homepage, thus I don't have to load the related JS file on other pages.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13481
    • Web Designer/Developer

    Re: Loading JS file on demand

    Posted 9 years 18 hours ago
    • I'm confused - if you're loading the JS in a module why can't you just assign the JS to the pages (menu items) that need it?

      Perhaps it would be better if your provided an example then please would you post your URL, superuser id and pswd in the secure tab of your post and i'll have a look for you.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.

Time to create page: 0.042 seconds