Inline

Inline scripts and style tags

Detailled description

Interface
These options are explained in detail here:

    • “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 calls for inline scripts with “inline” set to true

Multiple “inline skips” have to be separated by comma + space

Inlineskips Scripts skipped
‘adsbygoogle’ All inline scripts containing the string ‘adsbygoogle’

Example calls for inline scripts with “inline” set to false

Multiple “inlinehints” 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:
").ajaxify("are NOT fired on subsequent loads!

21 thoughts on “Inline”

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

  2. 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 http://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…

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

  4. 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 type="text/javascript" tag is changed to div class="ajy-script" type="text/javascript" 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 http://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

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

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

Copyright 2005-2016, 4nf.org. All rights reserved.
Latest update: 17. November 2016