Lab 11
In the lab 11 we had to reveal a message using jQuery and Ajax. In order to start the lab we had to create a simple webpage having a div holding the first message "Let jQuery Ajax Change This Text" and creating a button using the <button> tag. The <script> code used to make this happen is: $(document).ready(function(){
$("button").click(function(){
$("#div1").load("Text.txt");
});
});
This code allows to change the text once the button is clicked and locate the url "Text.txt" in the folder and
reveal the message stored in the file. This is very useful to a web designer because it allows for you to
swap out text using jquery in a simple click
Comments
Post a Comment