framework7

Open full view…

jQuery on all pages

jamestylerpatton
Wed, 30 Apr 2014 21:56:44 GMT

Is there a way to add jQuery to all pages instead of having to add javascript for specific pages only?

Vladimir Kharlampidi
Thu, 01 May 2014 09:21:22 GMT

Yes, anything you will write within 'pageInit' event will be executed for every page: --- $$(document).on('pageInit', function(){ //this code will be executed when any page loaded })

jamestylerpatton
Wed, 07 May 2014 19:57:48 GMT

I'm using a toggle function with jQuery inside this line of code (whic I want to use on the index page and other pages) but when I visit these pages more than once, the function starts calling more than once on the index page. Is there a fix for this?

Vladimir Kharlampidi
Wed, 07 May 2014 21:47:14 GMT

Can you show your code? I am not sure what you are trying to do