Validation issue with scripts
-
Hi,
Thanks for this great plugin. ?t fixes most of the errors with native AMP plugin.
I have just one error remaining to get validation. The following script is injected by theme and is there a way to block it.
I use Amp – AMP for WP – Accelerated Mobile Pages and Glue for Yoast
Error: The tag ‘script’ is disallowed except in specific forms.
is there a way to block the following code by this addon or functions php?
<script>
(function(){
var html_jquery_obj = jQuery(‘html’);if (html_jquery_obj.length && (html_jquery_obj.is(‘.ie8’) || html_jquery_obj.is(‘.ie9’))) {
var path = ‘https://www.doyouknowturkey.com/wp-content/themes/Newspaper/style.css’;
jQuery.get(path, function(data) {
var str_split_separator = ‘#td_css_split_separator’;
var arr_splits = data.split(str_split_separator);
var arr_length = arr_splits.length;if (arr_length > 1) {
var dir_path = ‘https://www.doyouknowturkey.com/wp-content/themes/Newspaper’;
var splited_css = ”;for (var i = 0; i < arr_length; i++) {
if (i > 0) {
arr_splits[i] = str_split_separator + ‘ ‘ + arr_splits[i];
}
//jQuery(‘head’).append(‘<style>’ + arr_splits[i] + ‘</style>’);var formated_str = arr_splits[i].replace(/\surl\(\'(?!data\:)/gi, function regex_function(str) {
return ‘ url(\” + dir_path + ‘/’ + str.replace(/url\(\’/gi, ”).replace(/^\s+|\s+$/gm,”);
});splited_css += “<style>” + formated_str + “</style>”;
}var td_theme_css = jQuery(‘link#td-theme-css’);
if (td_theme_css.length) {
td_theme_css.after(splited_css);
}
}
});
}
})();</script>
best,
- The topic ‘Validation issue with scripts’ is closed to new replies.