Quantcast
Viewing all articles
Browse latest Browse all 3201

vojtaripa on "Running XML script in wordpress webpage"

Hello, I'm trying to execute this code inside a wordpress webpage, but its not working. I copied and pasted this same code from my regular webpage that does work located at http://www.vojtaripa.com/mytest2.html

When I paste this code into my wordpress site below, the code no longer executes. Any ideas?
http://www.vojtaripa.com/testing

here is the code I have for the page:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script><script>// <![CDATA[
$(document).ready(function(){ $('#myTable').click(function(){ alert('hello world'); }); });
// ]]></script>
<table id="myTable">
<tbody>
<tr>
<td>blah blah blah</td>
</tr>
</tbody>
</table>

<hr />

<script>// <![CDATA[
function showUser(str){if(str==""){document.getElementById("txtHint").innerHTML="";return;}if(window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();}else{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4 && xmlhttp.status==200){document.getElementById("txtHint").innerHTML=xmlhttp.responseText;}}xmlhttp.open("GET","getuser.php?q="+str,true);xmlhttp.send();}
// ]]></script>

<form><select name="users" onchange="showUser(this.value)"><option value="">Select a person:</option><option value="vojta">Peter Griffin</option><option value="Vojta">Lois Griffin</option><option value="vojta ripa">Joseph Swanson</option><option value="Ripa Vojta">Joe MAMA</option><option value="Vojta Ripa">Vojta Ripa</option></select></form> 
<div id="txtHint"><b>Person info will be listed here.</b></div>

Here is another professional example of the code working...
http://www.w3schools.com/php/php_ajax_database.asp


Viewing all articles
Browse latest Browse all 3201

Trending Articles