Hi all I’m trying to do an API call using a jsonp setup with a script tag but not sure how to pass it a function as one of the parameters.
<script type="text/javascript" src="/proxy.cfm?apicall=news&pageid="+utils.stringToJson(cookie.read('current_stb')).pageid+"&callback='mynamespace.pagesCallback'"></script>
Can I add this right into the string like this.
+utils.stringToJson(cookie.read(‘current_stb’)).pageid+
Or is their a way for me to pass it as a variable.
I update the script based on Martins comments below.
<script type="text/javascript" id="script"></script>
<script>
$("#script").attr('href', "/proxy.cfm?apicall=news&pageid="+utils.stringToJson(cookie.read('current_stb')).pageid+"&callback="mynamespace.pagesCallback);
</script>
Now I’m getting a error missing ) after argument list but I’m not seeing where I left out a )
Just add an attribute
srcto the script