I use a php framework (Yii) for my code which includes jquery.js in each html form automatically for its validating functions. And i can’t do anything about it.
Here is the problem:
I get a piece of html, including the form and the jquery.js file, by ajax to show in a placeholder.
I already have a jquery.js in the page. So the second one comes in, and all other jquery plugins stop working and I should initiate them again!
I need to filter out the second jquery.js from my ajax return data.
How should i do it?
jQuery.ajax({
type: "GET",
url: $params.url,
data: $data,
dataType: $dataType,
success: function(data){
// data includes jquery.js code
callback(data);
}
});
What about using a callback function with something like the following: