html5shiv icon indicating copy to clipboard operation
html5shiv copied to clipboard

Last html5shiv.js doesn't work in ieTester

Open Jojaba opened this issue 12 years ago • 6 comments

Hello,

Sorry, but I'm not used to use github, so I don't know if this is the right place to submit this issue. I inserted the script by using the following lines in my header :

<!--[if lt IE 9]>
    <script src="https ://github.com/aFarkas/html5shiv/blob/master/dist/html5shiv.js"></script>
<![endif]>

It didn't work...

I tried it another way by uploading the script and doing it this way:

<!--[if lt IE 9]>
    <script src="path_to_file/html5shiv.js"></script>
<![endif]>

It didn't work either... :( IETester gave me an error message pointing to the line 4, character 1.

Line 3 :

m=/^<|^(?:a|b|button|code|div|fieldset|form|h1|h2|h3|h4|h5|h6|i|iframe|img|input|label|li|link|ol|option|p|param|q|script|select|span|strong|style|table|tbody|td|textarea|tfoot|th|thead|tr|ul)$/i,i,j;(function(){var a=b.createElement("a");a.innerHTML="<xyz></xyz>";i="hidden"in a;if(!(a=1==a.childNodes.length))a:{try{b.createElement("a")}catch(c){a=!0;break a}a=b.createDocumentFragment();a="undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}j=

Line 4 :

a})();var e={elements:d.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:!1!==d.shivCSS,shivMethods:!1!==d.shivMethods,type:"default",shivDocument:h};g.html5=e;h(b)})(this,document);

I deleted the space between line 3 and 4 and then it worked...

Could you fix this?

Thanks in advance.

Jojaba

Jojaba avatar May 18 '12 15:05 Jojaba

Try by using this code in your <head> section:

<!--[if lt IE 9]>
    <script src="html5shiv.js"></script>
<![endif]-->

vlakoff avatar May 18 '12 15:05 vlakoff

I updated my first post I don't know wich syntax to use to write code here sorry !!!

Jojaba avatar May 18 '12 16:05 Jojaba

I think a relative path to html5shiv.js won't be the good solution. I would prefer a direct link to github... ;)

Jojaba avatar May 18 '12 20:05 Jojaba

I would suggest against using GH as a source. what if file gets updated that breaks everything as your linking directly to a repo file... someone does need to update cdnjs version of html5shiv but its much more suitable for using as source..

http://cdnjs.cloudflare.com/ajax/libs/html5shiv/r29/html5.js

ctalkington avatar May 20 '12 05:05 ctalkington

Thanks for that advice ctalkington. Well, I will do like I do for the moment, upload the modified html5shiv.js file to my host and link to it in my head section, that's the best way, I think, not to be surpised by an upcoming problem...

<!--[if lt IE 9]>
    <script src="path_to_file/html5shiv.js"></script>
<![endif]>

Where path_to_fil is the path to the uploaded shiv file.

Jojaba avatar May 20 '12 06:05 Jojaba

gotcha, i have submitted some pull requests to cdnjs to add 3.5 versions of both print and non-print html5shiv.

ctalkington avatar May 20 '12 06:05 ctalkington