Hey,
I've seen some sites that do the following:
<a href="example.php" onclick="ajax_functionname(parameter)">Example</a>
Which then that function calls an external file and does what it's suppose to do.
I'm currently using jQuery and every example is done inline. Which means people can view the source, how it functions, what page gets requested, and most importantly it means I have to go to every page with that same function and edit it page by page.
For example, in one of my pages I do this:
Code:
$.ajax({
url: "test.html",
cache: false,
success: function(html){
$("#results").append(html);
}
});
I know that I could do $('.ajax').onclick(function () {...}) but it still shows what's happening.
How can I accomplish using this style instead?