Welcome Guest, Not a member yet? Register   Sign In
Dynamic ajax calls
#4

(08-06-2015, 02:58 AM)Urastor Wrote: It sounds interesting, but I have little idea what you mean. Like an script in a view, which creates variables (or objects), that stores CI-data and then include the external script, so that I could use those data? Is this right?

Exactly. Your view at some point will be including the main script, so you might put a script element before that inclusion which just defines a JavaScript object with some of the variables you've defined in CI, then your main script would check whether that object exists and pull in the data as needed.

It's not something I would consider a good long-term solution, but it's an easy way to pass data to a script, especially early in development and/or when testing new ideas/scripts.
Reply


Messages In This Thread
Dynamic ajax calls - by Urastor - 08-05-2015, 09:18 AM
RE: Dynamic ajax calls - by mwhitney - 08-05-2015, 10:48 AM
RE: Dynamic ajax calls - by Urastor - 08-06-2015, 02:58 AM
RE: Dynamic ajax calls - by mwhitney - 08-06-2015, 06:24 AM
RE: Dynamic ajax calls - by Urastor - 08-06-2015, 02:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB