Wait a minute now... you can't DO THAT??
Posted: Fri Nov 04, 2005 6:29 am
I have been using Serendipity since January now, but only now have I come across the need/desire to insert my own code IN AN ENTRY.
I have tried thus far (unsuccessfully) to embed javascript code in a new entry. At first I thought the extra <br> lines that the system seems to be adding (I tried checking the 'disable newline to br tag' option and using the textarea only input method) were screwing up the javascript interpreter.
Then I quickly tried a short PHP "hello world" test and realized from analyzing the HTML output that the PHP was not being interpretted.
This led me to believe of course that JAVASCRIPT is also not being interpreted.
Can code such as this not be imbedded in body text of an entry?
Is there maybe a setting I am forgetting about that would allow for this?
The JAVASCRIPT I was trying to get to work incidentally was the Google Maps API...
Any input?
James
PS - There is another script that is needed along with this script that I originally tried in the body text as well, but then moved it to the HEAD with still no success
I have tried thus far (unsuccessfully) to embed javascript code in a new entry. At first I thought the extra <br> lines that the system seems to be adding (I tried checking the 'disable newline to br tag' option and using the textarea only input method) were screwing up the javascript interpreter.
Then I quickly tried a short PHP "hello world" test and realized from analyzing the HTML output that the PHP was not being interpretted.
This led me to believe of course that JAVASCRIPT is also not being interpreted.
Can code such as this not be imbedded in body text of an entry?
Is there maybe a setting I am forgetting about that would allow for this?
The JAVASCRIPT I was trying to get to work incidentally was the Google Maps API...
Code: Select all
<div id="map" style="width: 500px; height: 400px"></div>
<script type="text/javascript">
//<![CDATA[
var map = new GMap(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.centerAndZoom(new GPoint(-122.1419, 37.4419), 4);
//]]>
</script>
James
PS - There is another script that is needed along with this script that I originally tried in the body text as well, but then moved it to the HEAD with still no success
Code: Select all
<script src="http://maps.google.com/maps?file=api&v=1&key=AABBCCDDEEFF" type="text/javascript"></script>