I’ve got some data in a weblog and I want to create a simple JavaScript array in one of my templates. However I can’t seem to figure out how to get JavaScript to accept the ee tag.
To debug this I created the following simple template to test this (which does nothing) :ohh: .
[removed]
{exp:weblog:entries weblog="myweblog" }
alert('{my_weblog_entry}');
{/exp:weblog:entries}
[removed]But if I just change the contents of the JavaScript alert (below) it works 😊 :
[removed]
{exp:weblog:entries weblog="myweblog" }
alert('WTF');
{/exp:weblog:entries}
[removed]In this example the weblog entries tag loops through all my posts and displays the alert message for each weblog entry. So there is something about
alert('{my_weblog_entry}');that is causing a problem.
I’ve seen posts in this fourm that suggest inserting line breaks before/after the curly brackets or putting $conf[‘protect_javascript’] = “n”; in the config.php file but none of these seem to work OR I don’t know how to implement them in my example.
So what would I need to do to get
alert('{my_weblog_entry}');to display my weblog content?
Chris