Mazel:test: Difference between revisions
From OpenWetWare
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<html> | <html> | ||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"> | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
$(document).ready(function() { | $(document).ready(function() { |
Revision as of 05:37, 7 March 2011
<html> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() {
$("a").click(function() { alert("Hello world!"); }); });
function loadJSON(url) {
var headID = document.getElementsByTagName("head")[0]; var newScript = document.createElement('script'); newScript.type = 'text/javascript'; newScript.src = url; headID.appendChild(newScript);
}
function processJSON(feed){
document.writeln(feed.title+'<BR>'); for(i=0; i<feed.channel.items.length; i++) { document.write("<a href='"+feed.channel.items[i].link+"'>"); document.writeln(feed.channel.items[i].title+"</a><BR>"); }
}
loadJSON('http://www.citeulike.org/json/group/5581?callback=processJSON');
document.writeln("coucou");
</script>
<a href="">Link</a> </html>