Permalink
Browse files

Last change refined

  • Loading branch information...
1 parent 904a8ff commit 2371867831f17cdb8571fa1340beecc14e43eaff @arvgta committed Jan 5, 2016
Showing with 6 additions and 5 deletions.
  1. +6 −5 ajaxify.js
View
@@ -336,22 +336,23 @@ pO("scripts", { $s : false }, { canonical: true, inline: true, inlinehints: fals
alltxts: function ($s) {
$s.each(function () {
var d = $(this).text(), t = $(this).attr('type');
- if(t && !t.toLowerCase().iO('text/javascript')) return;
- if (!d.iO(").ajaxify(") && ((inline && !_inlineskip(d)) || $(this).hasClass("ajaxy") || _inlinehints(d))) _addtext(d);
+ if (!d.iO(").ajaxify(") && ((inline && !_inlineskip(d)) || $(this).hasClass("ajaxy") || _inlinehints(d))) _addtext(d, t);
});
},
- addtext: function (t) {
+ addtext: function (t, type) {
if(!t || !t.length) return;
- if(inlineappend) try { return _apptext(t); } catch (e) { $.log("Error in apptext: " + t); }
+ if(!type) type = 'text/javascript';
+ if(inlineappend || !type.iO('text/javascript')) try { return _apptext(t, type); } catch (e) { $.log("Error in apptext: " + t); }
try { $.globalEval(t); } catch (e1) {
try { eval(t); } catch (e2) {
$.log("Error in inline script : " + t + "\nError code : " + e2);
}
}
},
- apptext: function (t) {
+ apptext: function (t, type) {
var scriptNode = document.createElement('script');
+ scriptNode.type = type;
scriptNode.appendChild(document.createTextNode(t));
$.cd("g").append(scriptNode);
},

0 comments on commit 2371867

Please sign in to comment.