I have a problem, I have written some jQuery scripts:
$(document).ready(function () {
$('#sshin').keyup(function () {
var query = $(this).val();
if(query != '') {
$.ajax({
url: "search.php",
method: "POST",
data: {query: query},
success: function (data) {
$('#sshout').fadeIn();
$('#sshout').html(data);
}
});
}
});
$(document).on('click', 'article', function () {
var text = $('#sshin').val();
text = text.substring(0, text.lastIndexOf(',') + 1);
text += $(this).text();
var uniq = text.match(/\b\w+\b/g).filter(function (el, idx, a) {
return idx === a.lastIndexOf(el);
});
text = uniq.join(',');
$('#sshin').val(text);
$('#sshout').fadeOut();
});
});
Of course in the index.html
file I included the jQuery library and my JS code. Everything worked perfectly fine when I tested it without being included from another file.
My problem is now that my index.html
is being included by another file (which I can't change at all) and apparently interferes with other JS, e.g. JQuery Code..
Is it possible to just use the jQuery library I included only for this script or or do you have any other ideas?
If you need any other information let me know.
Error Output:
slim.js:3
Uncaught TypeError: $(...).live is not a function
at chooseLinkContainer (slim.js:3)
at HTMLDocument.<anonymous> (slim.js:3)
at k (slim.js:2)
at Object.fireWith [as resolveWith] (slim.js:2)
at Function.ready (slim.js:2)
at HTMLDocument.D (slim.js:2)
jquery-1.10.2.js:8672
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
piwik.js:58
Uncaught Error: A siteId must be given to add a new tracker
at K.addTracker (piwik.js:58)
at Object.addTracker (piwik.js:66)
at piwik.js:69
at piwik.js:69
at eval (eval at <anonymous> (jquery-1.10.2.js:612), <anonymous>:3:10)
at eval (<anonymous>)
at jquery-1.10.2.js:612
at Function.globalEval (jquery-1.10.2.js:613)
at init.domManip (jquery-1.10.2.js:6281)
at init.append (jquery-1.10.2.js:6047)
Error Messages after i removed my Jquery Reference:
slim.js:2 Synchronous XMLHttpRequest on the main thread is deprecated
because of its detrimental effects to the end user's experience.
For more help, check https://xhr.spec.whatwg.org/.
piwik.js:58
Uncaught Error: A siteId must be given to add a new tracker
at K.addTracker (piwik.js:58)
at Object.addTracker (piwik.js:66)
at piwik.js:69
at piwik.js:69
at eval (eval at <anonymous> (slim.js:2), <anonymous>:3:10)
at eval (<anonymous>)
at slim.js:2
at Function.globalEval (slim.js:2)
at HTMLScriptElement.<anonymous> (slim.js:2)
at Function.each (slim.js:2)