sage icon indicating copy to clipboard operation
sage copied to clipboard

wp_localize_script not running

Open kevinsperrine opened this issue 14 years ago • 11 comments

I've just migrated to Roots, and I'm having problems with a couple of my plugins that use wp_localize_script to load javascript data failing. The content is simply never pushed to the page. Can anyone confirm this?

kevinsperrine avatar Jan 27 '12 18:01 kevinsperrine

i must have introduced this recently with eca31bd91508eaf9b2482a08712c0dfd0300f5f1

retlehs avatar Jan 27 '12 18:01 retlehs

which plugins were you talking about?

retlehs avatar Feb 01 '12 22:02 retlehs

Promotion Slider and Basic Google Maps Placemarks

Kevin

Sent from my Samsung Epic On Feb 1, 2012 2:26 PM, "Ben Word" < [email protected]> wrote:

which plugins were you talking about?


Reply to this email directly or view it on GitHub: https://github.com/retlehs/roots/issues/259#issuecomment-3768535

kevinsperrine avatar Feb 01 '12 22:02 kevinsperrine

fixed, let me know if you have any other issues

retlehs avatar Feb 13 '12 15:02 retlehs

running into the same thing working on #279 - from what i can tell anything scripts registered and pointed to the footer with wp_register_script are not showing up

retlehs avatar Feb 13 '12 23:02 retlehs

Hi,

First of all: sorry, I'm a massive github noob and semi wordpress noob.

I'm currently trying to get ajax pagination working on a site, but the javascript data isn't getting loaded (possibly to wp_enqueue_script not working for me).

The plugin i'm having problems with is this: http://www.problogdesign.com/wordpress/load-next-wordpress-posts-with-ajax/

Even if I dont use a plugin and just try to use simple ajax pagination (using jQuery and this tut: http://wpcanyon.com/tipsandtricks/the-easy-way-to-make-wordpress-ajax-pagination-using-jquery/) I can't get it working. The new data/next page simply doesnt load.

The latest update to Roots solved some of the problems, which means the plugins above actually loads, but they still arent working completely.

Both of the plugins worked in Roots 4.0 (though only with "Relative URLs" disabled).

Help would be much appreciated since I have a deadline on the site this week. :)

Anderrs avatar Feb 13 '12 23:02 Anderrs

try the latest roots-scripts.php after the commit i just pushed: 5ec10a529635a01c6a5e859f419677a8597da1c4

retlehs avatar Feb 14 '12 00:02 retlehs

I got the ajax plugin working, but I fixed that before the latest commit. I can however say that this latest commit hasn't fixed the ajax issue with the second link I posted, but i dont know if its a bug or just me failing.

There is one thing that seems a bit strange though. The first plugin puts this script in my footer in the older version of Roots: <script type='text/javascript'> /* <![CDATA[ */ var pbd_alp = {"startPage":"1","maxPages":"3","nextLink":"http:\/\/xxx\/xxx\/page\/2\/"}; /* ]]> */ </script>

but in this version it puts this in the header instead:

    var pbd_alp = {"startPage":"1","maxPages":"3","nextLink":"\/xxx\/page\/2\/"};
</script>```

I really dont know if this has any signifigance to anyone else than me, and if its even a bug. :)

Anderrs avatar Feb 14 '12 00:02 Anderrs

are you getting javascript errors?

retlehs avatar Feb 14 '12 01:02 retlehs

No I'm not. And again; I'm not really sure if its a bug. :) Everything seems to be working for me.. I just thought others might have problems with it, so wanted to let you know.

Anderrs avatar Feb 14 '12 01:02 Anderrs

i have a same problem, using roots 4.0.0 version foundation css framework and wp-ecommerce , gold cart developer plugin for ecommerce, problem with wp_localize_script with other themes wp-ecommerce , gold cart developer plugin works but not in roots, i figured out wp_localize_script not working and i am here, whats the diff between version 4 and 5 of roots script file? how can i overcome in 4th version to solve same?

amolv avatar Apr 04 '12 10:04 amolv