Framework.js gives error on internet explorer 8 - javascript

I'm facing a problem on internet explorer 8 while including the IN API. Here's the code, I'm not doing anything fancy at all, just including some files.
<script type="text/javascript" src="https://platform.linkedin.com/in.js">
api_key: <?php echo API_KEY . "\n"; ?>
credentials_cookie: true
authorize: true
</script>
<script type="in/login" data-onAuth="onLinkedInAuth"></script>
And then I have this onLinkedInAuth function defined that isn't doing much right now. This piece of code produces an error in IE8, coming from the framework.js file, refering to line 1070 :
b.fn.apply((b.scope||window),c)
Has anyone fixed that before ?!

Related

wordpress js mobile redirection script only if fronpage not working

I've created a mobile redirection js file using these excellent instructions (even though I'm still unsure how to redirect my SSL protected site to a non-protected mobile site without getting rid of the https:// prefix...).
However, this is not the issue at hand.
I'm getting no joy when trying to restrict this mobile redirection script, so it will only work for the front-page.
I.e. http://example.com -> http://m.example.com
but a single page such as http://example.com/contact/ (which uses the same header.php template), will remain the same also for mobile too.
This is how I added the script to the header.php, but as stated before, it's not doing the job:
if ( is_front_page() && is_home() ) {
echo '<script type="text/javascript" src="http://piccolo.co.il/js/redirection-mobile.js"></script><script type="text/javascript">// <![CDATA[
SA.redirection_mobile ({
mobile_url : "m.piccolo.co.il",
});
// ]]></script>';}
</head>
currently every page gets redirected to the mobile version's homepage, and the if is_front_page is being ignored.
My website is http://piccolo.co.il if anyone would like to inspect the code.
Many thanks!
Jon
I've solved it by getting rid of the 'echo' and implementing this code (still in the header, as I didn't quite understand the above reply).
I was advised to use only is_front_page, given the fact that is_home can work a bit awkwardly at times.
<?php wp_head(); ?>
<?php if ( is_front_page() ) { ?><script type="text/javascript" src="http://piccolo.co.il/js/redirection-mobile.js"></script><script type="text/javascript">// <![CDATA[
SA.redirection_mobile ({
mobile_url : "m.piccolo.co.il",
});
// ]]></script>';}<?php } ?>

Ajax-loaded JQuery issue in IE

I have a website with many products, from within the listing I have a link to a fancybox which opens a full detail of the product (detail.php file)
<a class="fancy fancy'.$_GET['type'].'" href="detail.php?id='.$equip[$c]['equipId'].'">'.$equip[$c]['equipment'].'</a>
The problem is that I have some jquery script inside detail.php, it works fine in every browser except internet explorer, in which I get error $ not defined or JQuery not defined. Above is the jquery code in detail.php
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script type="text/javascript" src="js/vendor/jquery-1.10.1.min.js"><\/script>')</script>
<script type="text/javascript" src="Resources/Script/jquery.imageLens.js"></script>
<script type="text/javascript" src="Resources/Script/jquery.nicescroll.js"></script>
<script>
window.onload = function(){
$("#<?php echo $_GET['id'];?>").imageLens({borderSize: 4, borderColor: "#FFF",lensSize: 200,imageSrc: "<?php echo "Resources/Image/equipamiento".$row['link'];?>_B.jpg"});
$(".niceScroll").niceScroll({cursorborderradius:"0px",cursorwidth:4,cursoropacitymin:0.5,cursoropacitymax:0.7,background:"#c9c9c9"});
}
$("#catDesc<?php echo $_GET['id'];?>").click(function(){
if(!$("#catDesc<?php echo $_GET['id'];?>").hasClass("active"))
{
$("#tech<?php echo $_GET['id'];?>").fadeOut('fast',function(){
$("#desc<?php echo $_GET['id'];?>").fadeIn('fast')
$("#catDesc<?php echo $_GET['id'];?>").addClass("active")
$("#catTech<?php echo $_GET['id'];?>").removeClass("active")
})
}
})
$("#catTech<?php echo $_GET['id'];?>").click(function(){
if(!$("#catTech<?php echo $_GET['id'];?>").hasClass("active"))
{
$("#desc<?php echo $_GET['id'];?>").fadeOut('fast',function(){
$("#tech<?php echo $_GET['id'];?>").fadeIn('fast')
$("#catTech<?php echo $_GET['id'];?>").addClass("active")
$("#catDesc<?php echo $_GET['id'];?>").removeClass("active")
})
}
})
</script>
It looks like your jQuery is undefined because you're referencing a cdn and it is a security issue in some versions of IE. I would recommend downloading jquery and referencing it locally and seeing if that clears up your problem.
Whenever you have $ is not defined, you are not loading the library you are using. That may be caused by IE but I also see you're using "window.onload" and that is "usually" a bad idea (especially for IE) when triggering javascript.
My guess is window.onload behaves differently and possibly reloads the window. Which could be why $ is no longer defined and the library fails to load. Something to keep in mind.

This JQuery website wont work on IE11 f or some reason(Fade in's etc)

I know this code should be working as i've done other websites where it works on both.
http://johslan.tk/
refuses to work in IE 11( The buttons dont do anything)
If you load the page in IE11 and then go to the Console in the F12 developer tools, you see the following Script error:
SCRIPT5009: 'jQuery' is undefined
File: jquery-ui.min.js, Line: 1, Column: 3
Which indicates the page is loading JQuery-UI before it loads JQuery.
Looking at the source on http://projoh.altervista.org/ I see you have the following HTML:
<script type="text/javascript">
google.load("jqueryui", "1.5.2");
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
Try switching the two tags and I am guessing it will fix the issue.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
google.load("jqueryui", "1.5.2");
</script>
Hope that helps.

JQuery Signature not working for IE <= 9

I am using JQuery Singature and I encountered this Error Message for above IE version:
Message: Canvas element does not support 2d context. jSignature cannot proceed.
update : After Added the (;) in the flashcanvas.js
The Problem is the Same:
Message: Expected ';'
flashcanvas.swf
Code: 0
I have downloaded the flashcanvas.swf and flashcanvas.js from:
https://github.com/brinley/jSignature/blob/master/libs/flashcanvas.js
https://github.com/brinley/jSignature/blob/master/libs/flashcanvas.swf
these two files I placed them in a Folder called Script.
It does not matter if I include or did not include flashcanvas.swf What I need to do?
here the javascript
<!--[if lte IE 9]>
<script type="text/javascript" src="Script/flashcanvas.js"></script>
<script type="text/javascript" src="Script/flashcanvas.swf"></script>
<![endif]-->
<script type="text/javascript" src="Script/jSignature.js"></script>
<script type="text/javascript">
$(document).ready(function (){
$("#divSignature").jSignature({width:400, height:140, mousedown:function(){}});
});
</script>
Just a syntax error, simply update the following at line 928 of flashcanvas.js:
function getSwfUrl(window) {
return ( (window[FLASH_CANVAS + "Options"] || {})["swfPath"] || BASE_URL ) + "flashcanvas.swf"; //Added semicolon
}
IE tend to be less lenient towards Javascript errors, which can be a good thing for programmers learning the language. Browsers like Chrome can accommodate a fair amount of JS errors and still correctly execute a script.

Why does the icon from Brazen Careerist trigger a SCRIPT1014 error in Internet Explorer?

I put in this link to my profile on Brazeen Careerist on my web page (www.ctrlaltm.com). Whenever I load this page in any version of IE, I get the following error:
SCRIPT1014: Invalid character
widget_tracking.1.js, line 6 character 39
The code for the icon came from Brazen Careerist (http://www.brazencareerist.com/help/badges/icon) and is the following:
<a id="sicon-bclink" name="My Brazen Careerist Social Resume" href="http://www.brazencareerist.com/profile/maggiet?utm_source=22088&utm_medium=single&utm_campaign=icon"><img border="0" alt="My Brazen Careerist Social Resume" src="http://static.brazencareerist.com/v6/ui_widget/icons/icon_bc.png"/></a>
<script type="text/javascript">var bctrk_cat = "icon";var bctrk_act = "SingleView";var bctrk_uid = "22088";</script>
<script src="http://static.brazencareerist.com/v6/ui_widget/widget_tracking.1.js" type="text/javascript"></script>
I checked the debugger in IE9's developer tools but when I checked where the error had happened all it said was the problem was line 6, character 39 which pointed to a left quotation mark. This didn't make any sense to me. The only potential problem I could think of was when I changed the & to & a m p ; (spaces added only here to show the character entity) in the original link to get to validate under HTML 4.01 Strict it messed up the JS somehow but I'm not sure why that would happen.
This isn't a problem with Internet Explorer, nor is it exclusive to Internet Explorer. Opening the same page up in Chrome reveals the following in our console:
Uncaught SyntaxError: Unexpected token ILLEGAL ... widget_tracking.1.js:6
Same message you're getting in the IE console too. When we look at this section, we find that you have slashes before the double-quotes, which is wrong.
var bcPageTracker = _gat._getTracker(\"UA-3762378-1\");
Change to:
var bcPageTracker = _gat._getTracker("UA-3762378-1");
Of course, once you fix this you're going to be met with the next error: SCRIPT5009: '_gat' is undefined. This is because you attempted to join two script tags into one .js file. My advice is for you to download your tracking code again, paste it into the footer of your site, and not tamper with it any further.
This is how you're supposed to use this code:
<!-- Google Analytics Code -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3762378-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- End Google Analytics Code -->
</body>
This is line 6, if you look real hard you'll see the invalid character
var bcPageTracker = _gat._getTracker(\"UA-3762378-1\");

Categories