Inline scripts and style tags
Transparency policy
Pertains both to inline and external scripts:
In the latest versions, scripts are passed through on a 1:1 basis. That means, that they are hooked out of the target page and hooked back into the main page without modification. That way, you have maximum control but also complete responsibility. Nevertheless, Ajaxify still has a read-only peek into the script text, giving rise to the following hints:
Detailed description of inline-script hints
- “inline” set to “true”: All inline scripts are re-fired, no matter what the contents of “inlinehints” is, but excluding those specified in “inlineskip”
- “inline” set to “false”: No inline scripts are re-fired, except those with class=’ajaxy’ and those specified in “inlinehints” (see examples below):
- “style” set to “true”: All new style tags are loaded
- “style” set to “false”: All new style tags are ignored
Example hints for inline scripts with “inline” set to true
Multiple hints have to be separated by comma + space
inlineskip | Scripts skipped |
---|---|
‘adsbygoogle’ | All inline scripts containing the string ‘adsbygoogle’ |
Example hints for inline scripts with “inline” set to false
Multiple hints have to be separated by comma + space
inlinehints | Scripts re-fired |
---|---|
‘SyntaxHighlighter’ | All inline scripts containing the string ‘SyntaxHighlighter’ |
‘SyntaxHighlighter, WP_’ | All inline scripts containing the string ‘SyntaxHighlighter’ or ‘WP_’ |
Avoiding unwanted recursion
Inline scripts that contain the string:
"new Ajaxify("
are NOT fired on subsequent loads!
Hi, i have a google banner inside of #site div,
but after page load with ajaxify banner is not showing,
jQuery(‘#site, #header, #footer’).ajaxify({
forms: false,
inline:true,
verbosity: 20
});
what i missed?
i would ask if there any way to add a animation during page load?
Thanks
Hi,
thanks for your interest in Ajaxify!
What version of Ajaxify are you using? Could you please provide a link to your site, if possible?
Just another small thing – try inserting a space in
inline: true
Yes, you can use the built-in animations or hook into the Pronto events in order to initiate your own…
If you’re using Adsense please read the docs…
Hi,
version: https://cdnjs.cloudflare.com/ajax/libs/ajaxify/6.9.2/ajaxify.min.js
site link: keepone.net,
Hi,
thanks for posting back!
Great site!
Please read the docs on using Adsense with Ajaxify.
To cut a long story short, it is more complicated to integrate an ad in the content div(s).
It’s much easier to integrate it outside of the content div(s).
Also – feel free to test version 7.0.0, if you like…
If you have some follow-up questions, please post back.
Thanks and
Regards
Hi, i had problem on my smart tv bcz of version 7.0 version. But 7.1 is working good.
Hi Brdn,
thanks for your feedback. It might be due to
bodyClasses
handling? Main thing is, that it works now…Thanks and
Regards
Hi,
how can i skip 2 things in “inlineskip”?
i tried inlineskip: “adsbygoogle, adsbyxxx” and didn’t work
Thanks
Hi Brdn,
yes, exactly: separated by “comma and space”.
I checked your call of Ajaxify and you might want to wipe out:
inlinehints:true
…which doesn’t make any sense
Thanks
Hi admin,
Thank you, i removed “inlinehints:true”
i’m trying to active page level ads, hope i can fix the problem
“Only one ‘enable_page_level_ads’ allowed per page.”
Hi Brdn,
have you had a look at setting up Google Adsense?
Maybe what you’re trying to do is analogue to it?
Otherwise please elaborate on what you’re trying to do…
Hi Sir,
Congratulations & thanks for sharing your work : that is simply a real pleasure to get it action !
Mmm, i meet a problem with inline script and i hope you will have a couple of minutes to help me :
One of my reply contains :
Try me…
$(function(){
$(‘#date-picker-example’).pickadate();
});
And i got this message in console :
Bad inline script text in apptext:
$(function(){
$(‘#date-picker-example’).pickadate();
});
My options are :
jQuery(‘#body_main_container’).ajaxify({
maincontent: “#body_screen_container”,
prefetch : false,
memoryoff: true,
verbosity: 10,
inline: true,
deltas: true,
inlinehints: “ajaxy”
});
Thanks by advance for your help,
Regards,
Sebastien.
Hi there!
Thanks for your enquiry and using Ajaxify.
Could you please try the following:
jQuery(function(){
jQuery(‘#date-picker-example’).pickadate();
});
Regards,
Arvind
Excelente script!
I have a question, I have some extra js but not charged even facebook comments either, as it could fix it?
and also to update my menu to activate the current menu?
my project is this: http://masradio.mx
Hi Alejandro,
it’s a bit of a communications problem – I can’t understand you.
Thanks for the link! Great site!
You have an error in the console – could you please take care of that first?
I had a look at your Ajaxify call in here:
– http://masradio.mx/themes/mrmx/js/scripts.js
It looks alright, but you could try calling with the simplest configuration first:
jQuery('#main').ajaxify();
(because you’re vastly using the defaults anyway)
Regards
Sorry, I do not write English well and use translator
Thanks!
I corrected the errors and console.
I am using ajax fi as you mention.
Font Awesome use it with your CDN but calls a js and using standard ajaxify not show icons
– The facebook comments plugin does not work when using ajaxify
You can check the top menu any section icons are not visible and there is a blue button on listings which opens a hidden menu with social networks and does not work
As you can do to make the main menu when entering a section is active?
I found a history.js but obsolete which use it and got the div of the new menu and replaced it with ajaxify can be done?
Demo menu: http://soundwave.wizedesign.com/
//Append new menu HTML to provided classs
var request = $(data);
$(‘#main’).replaceWith($(‘#main’, request));
similar?
sorry I had to put in $.getScript js to run internal scripts, but the main menu is not working the submenu
Please i have BIG problem:
in my pages have some ADV script with document.write …
how can solve?
thanks
Please i have BIG problem:
in my pages have some ADV script with document.write …
how can solve?
thanks
I’m afraid that’s impossible, since I work on the localhost, but I can send you an example of non-working code
Sure, please send it via eMail, I’ll do what I can do…
But it might take some time…
Hello, I have a problem when working with your plugin.
When changing pages, I need to be rebooted one script, it contains information like:
Info = new Array;
Info['page'] = 'home';
Info['user'] = 5;
.....
All settings are standard, how can this be done?
And yet it would be great to add a method to the plugin, which will be called before the page loads.
Hi Max,
just a short question – you are using “script” tags, right?
If so, it should work, as
inline
is set totrue
be default…Have you had a look at the Pronto events available?
Thanks and regards
Yes, I use a script tag, but it is in the head tag.
In the settings, inline: true, forms: false
Hi Max,
it shouldn’t really matter, where the “script” tag is – it should be re-fired.
Could you do the following, if possible:
1) Drop a link to your site
2) Hotlink to https://4nf.org/ajaxify.js, so I can add some
$.log()
messages…Otherwise feel free to contact me via eMail, if you need it to be treated discretely…
Hello.
I use
$('#content').ajaxify({'verbosity': 0, requestDelay:400});
Some pages have inline scripts like that:
<script>
<script>
But when use Ajaxify< that code doesn't run, more than, if look for page source, it would be next:
<script>
<script>
Whithout any code in script tag.
What can you advise?
Hello Ilya,
thanks for your interest in the plugin!
It seems that WordPress strips out the “script” tags.
Could you re-submit the script, without “script” tags,
and possibly the error message as well?
Thanks!
Html tags were stripped from my previous reply,so I’ll rewrite it.
Hi.
I use the standard
jQuery(‘#content’).ajaxify();
code. Pages load very nice, however my inline javascript code which is inside the #content isn’t fired. Thescript
tag is changed todiv class="ajy-script"
and the javascript code inside is visible on the site as a normal text. How can I fix that?Hi Kfinto,
please excuse the delay, only saw that comments were pending just now…
One question before we go into detail – how have you set the parameter for “inline“?
(It should be set to “true“)
Maybe if not top secret you could provide a URL to the test page…
I would doubt, that the scripts aren’t fired at all, if you set the above parameter correctly.
Feel free to have a look at our partner-site: http://www.oeko-fakt.de/.
There are at least two inline scripts being handled correctly within “#content”.
One for the date at the top of the content section and one for displaying the PageRank Bar…
Hi!
Thanks for the reply. I can provide more details as I worked on that a bit. I use
jQuery('#content_ajax').ajaxify({requestDelay:300});
, there is no ‘inline’ parameter specified, so it’s value should be ‘true’ as default. I was wrong. Almost all inline scripts are fired but there are also created divs with js code (their class is .ajy-script so i set display:none on them. They are invisible now but they are still there). Almost all inline scripts are fired – those containing another ajax requests (to get data from youtube) didn’t work, so I moved them to the header and I use .each to fire them when proper elements are loaded on the site.To sum up, I found a workaround for this issues but they are still existing. (This is a temporary site and will be changed in the near future)
Thank you for the plugin. Everyting but this works great.
I’m not sure if u got the URL I put in the Website field because it’s not shown anywhere. http://tempsite1.bl.ee/ . Inline code is present in single playlist.
Hi again and thanks for clarifying that!
So the scripts are fired but the nuisance is “rests” of the scripts remaining on the page as divs with ‘.ajy-script’ class.
This is, strictly speaking a bug and now has top priority for me.
I will modify the code, when pulling in the scripts from the target page.
Ideally that would do the trick…
I’ll implement and test this asap!
Thanks for your awareness – nobody had posted about this before, but it surely was a nuisance for one or the other.
Done, presumably 🙂 (the only file, that contains the new logic is https://4nf.org/ajaxify.js at the moment, feel free to test)
I’ve tested against our partner site: http://www.oeko-fakt.de/ by seeding the following code there (towards the top of the pages, right beneath the date)
console.log("Test")
in “script” tags…The “script” tags along with the
console.log
… survive the dynamic loading of #content.I presume the bug only pertained to the content divs that were loaded dynamically.
Please test against your site and give us a hint, whether it works…
Thanks and regards
Hi.
I use the standard “jQuery(‘#content’).ajaxify();” code. Pages load very nice, however my inline javascript code which is inside the #content isn’t fired. The tag is changed to and the code is visible on the site as a normal text. How can I fix that?