简体   繁体   中英

javascript script type text defining

i saw in a website defining script type tag like this , please can anybody tel me what is that " type="text/javascript+fk-window-onload-executed ">, what is this " +fk-window-onload-executed " mean?? and why they are using such type..

when i execute below code, code is not executing but when i remove +fk-window-onload-executed then its working fine

  <script type="text/javascript+fk-window-onload-executed"">
(function () {
try {
    var Lastclick = true;
    var viz = document.createElement('script');
    viz.type = 'text/javascript';
    viz.async = true;
    viz.src = ("https:" == document.location.protocol ?"https://" :   "http://localhost")+ "/projects2/857/VIZVRM857.src.js";
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(viz, s);
    viz.onload = function () {
        try {
            pixel.parse(Lastclick)
        } catch (i) {}
    };
    viz.onreadystatechange = function () {
        if (viz.readyState == 'complete' || viz.readyState == 'loaded') {
            try {
                pixel.parse(Lastclick)
            } catch (i) {}
        }
    }
 } catch (i) {}
   })();</script>

please anybody tell me, why they are using such type definition and what is the benefit of using such type.

Thanks in advance.. Please help

From looking at the source you provided this is a custom document type flip kart is using (fk == Flip Kart). My guess would be they are using it to prevent reloading the script on certain occasions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM