Pass: 0

Inline

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

Interface

  • “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!

41 thoughts on “Inline”

  1. 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

        1. 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

          1. Hi Brdn,

            thanks for your feedback. It might be due to bodyClasses handling? Main thing is, that it works now…

            Thanks and
            Regards

          2. Hi,
            how can i skip 2 things in “inlineskip”?
            i tried inlineskip: “adsbygoogle, adsbyxxx” and didn’t work

            Thanks

          3. 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

          4. 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.”

  2. 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.

    1. Hi there!

      Thanks for your enquiry and using Ajaxify.

      Could you please try the following:

      jQuery(function(){
      jQuery(‘#date-picker-example’).pickadate();
      });

      Regards,
      Arvind

  3. 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

    1. 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

      1. 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?

  4. Please i have BIG problem:
    in my pages have some ADV script with document.write …
    how can solve?
    thanks

  5. Please i have BIG problem:
    in my pages have some ADV script with document.write …
    how can solve?
    thanks

  6. I’m afraid that’s impossible, since I work on the localhost, but I can send you an example of non-working code

  7. 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.

        1. 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…

  8. 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?

    1. 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!

  9. 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. The script tag is changed to div class="ajy-script" and the javascript code inside is visible on the site as a normal text. How can I fix that?

    1. 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…

      1. 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.

          1. 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.

          2. 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

  10. 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?

Leave a Reply to kfinto Cancel reply

Your email address will not be published. Required fields are marked *

Show Buttons
Hide Buttons