I'm trying to bind some functions to an event.
The following code works perfectly fine in Chrome and FF but what's the corresponding code for IE?
$this.mouseenter(function(){
console.log("inside the mouse enter handler");
});
I tried this but it didn't work in IE:
$this.bind('mouseenter', function(){
console.log("inside the mouse enter handler");
});
I need it to work in at least IE 9.
console.log or at least console will give you an error on IE... hence, your javascript will not work... try using alert...
Unable to understand what is wrong # your end.
I tried this and its working fine for me.
console.log will return a js error, if your browser's console is not open. It will happen in any browser, not only with IE. Probably you tried FF and chrome with the browser console open and IE without opening the browser console. Try opening the browser console open in IE as well / by using alert() to test your funcitonality / by directly writing the functionality that you need.
Hope it helps!!!
Related
I feel like I'm going crazy but alert() and console.log() refuses to work anywhere on Firefox 26.
At first I thought it was my own website's problem, but I cannot for the life of me to get it to work via javascript: urls, Firebug, I even tried it in jsfiddle.net by just putting alert('test'); in the script panel.
Tried uninstalling and installing again, no luck.
The only extension I'm running is Firebug.
Heck, Stackoverflow didn't even prompt me about leaving when I accidentally clicked the back button while writing this.
Also yes, I made sure there was some content inside the alert() and console.log()
What I mean by not working is that Firefox treats the code as if it were non-existent, nothing happens.
Once again, here's my environment:
Browser: Firefox 26.0
OS: Windows 8.1 Pro
Issue: alert(), console.log(), and apparently prompt() doesn't work
If anyone might know why this is happening, I would highly appreciate an answer.
UPDATE
Following Pointy's comment, it appears that both alert() and console.log() work as expected on the New Tab Page, but nowhere else
You might want to try re-installing Firebug:
console.log in firefox is not working?
PS:
I happen to be running a similar configuration (including FF 26) ... and things work fine for me. IMHO...
PPS:
You might also try setting "about:config, prompts.tab_modal.enabled = false":
https://bugzilla.mozilla.org/show_bug.cgi?id=613752
The default is "true", my FF 26 is set "true" and things are working for me ... but who knows. If reinstalling Firebug doesn't help, maybe it's worth a shot?
Silly but, in firebug can you check if window.alert and window.console are defined.... and if yes then, can you check if window.alert('hi') works ?
Thanks for all the help guys, in the end I used Revo Uninstaller to completely and absolutely wipe Firefox from my system, then installed it again. Seems to be working now, the original uninstaller most likely didn't remove whatever was causing the problem.
I have same bug when i using Ghostery extension. Disable Ghostery and reload page. Lets check at https://getfirebug.com/tests/head/console/api/log.html
I had a similar issue, on IE v11.0.10 and Chrome Canary v38.0.2114. Duplicate function name turnout to be the issue. Worth doing a quick check for function names in Javascript file.
You can use the Firefox console with CTRL + SHIFT + K
Related: https://support.mozilla.org/en-US/questions/876916
I am trying to use the following JQuery code:
$("#thing").on("click", function() {
....})
And it doesn't work on Google Chrome in Windows 8, but it works in Firefox on Windows 8 and basically every other OS. Any ideas?
It works, check this: http://jsbin.com/ofuvuh/1 Probably there is some error in the code that ff ignore or maybe it's your browsers fault. Please check the chrome and ie console, probably it can helps
Try:
$("#thing").click(function ()
{
// your code here
});
Which is the same as .on('click', handler). See .click documentation.
Your code snippet looks completely fine. I assume you are using a fairly up to date version of jQuery, so most probably it is nothing to do with jQuery or the browser. I suspect there might be something wrong with the code surrounding your snippet.
As a possible solution:
In Chrome you can bring up the Console, which will tell you if there is any errors in your JavaScript (developers.google.com/chrome-developer-tools/docs/…). Open it up, refresh your page (you might see the error in the Console straight away). Or click that '#thing' and watch out for any possible errors coming up in the Console.
My html page cannot work in IE browser. If I turn F12 developer tools on, it starts to work. My page can work with chrome. I guess it is caused by jquery and javascript. Can anyone know how to make it work? Thanks
IE crashes your script if you're using console.log anywhere inside it. Developer tools adds the console functionality - therefor it works if you open it. Remove the console.log and it should start working just fine.
Chrome/Firefox support this by default, thats why it works there no problem.
you're probably using console.log() in your code somewhere. In IE console object doesn't exist unless the dev tools window is active.
I have an alert box, and when I run that code in Firefox, no matter what program I have over firefox, firefox appears with the pop-up automatically over other programs open.
This however, does not work in Chrome.
What gives? Would this be a perference change or this there a line of code that says focus on this window.
I used
window.blur();
window.focus();
and that fixed my problem :)
The implementation of alert is browser specific. Unfortunately there is not line of javascript code to change this.
If you want to have customizable (and working the same in every browser) alert window, use jquery UI.
Note: It will be over the actual page, not over the (other) window.
I created a textbox and wrote onfocus="getFocus()" //"getFocus();" also not working.
Now I wrote function in JavaScript:
function getFocus()
{
alert('Hello I Got Focus !!');
}
The problem is in IE8 it worked perfectly, but in IE9 alert is not showing. Can anyone tell what is wrong with the following code?
I also tried:
txtAmt.Attributes.Add("onfocus","getFocus()")
txtAmt.Attributes.Add("onfocus","getFocus();") //also not working
but still it didn't worked
I too tried:
txtAmt.Attributes.Add("onfocus","javascript:getFocus();")
In Internet option ActiveScripting is also 'Enabled'
Now I am worried; what to do?
Please Make sure if java script is enabled in your browser .Enable it or rest
Go to tools -> internet options -> advanced -> reset and it'll go back to default after restart. Also restore advanced settings.
http://jsfiddle.net/TTxdK/ - tested in IE9 on Windows Vista, onfocus works