Created
August 18, 2013 05:51
-
-
Save thecfguy/6260110 to your computer and use it in GitHub Desktop.
Method2: Call jquery.ajax and display response in variable div
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="/js/jquery-1.4.2.min.js" type="text/javascript"></script> | |
<script> | |
function loadMe(){ | |
$.ajax({ | |
url:"scribble2.cfm?", | |
success:function(res){ | |
showMessage(res,"div1"); | |
} | |
}); | |
} | |
var showMessage = function(res,divId){ | |
$("#" + divId).html(res); | |
} | |
</script> | |
<style>div { height:40px; border:1px solid #000;margin: 5px 5px 5px 5px;}</style> | |
</head> | |
<body> | |
<div id="div1"></div> | |
<a href="javascript:loadMe()">Load Message</a> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment