Javascript on Internet Explorer (spring mvc thymeleaf project) - javascript

Okey!
So I am running a Spring MVC Thymeleaf project. I have a simple alert which should show each time when I start my site. This works perfectly except for when I try it with Explorer (IE11). Tried on Chrome, Edge, Firefox.
Its a very simple "alert ("hello")" in document.ready
I tried to "allow javascript" on internet explorer. It still doesnt work, i tried if javascript is allowed by going to different sites.
Hmmm what more could be more relevant.
I tried to ad localhost to "trusted" sites, doesnt work.
I tried the code on jfiddle and sites like this, works a treat.
I have localhost so the site is not "secure" obv, this is not the problem because I have tried the code on the host aswel. I have googled and tried but I cant do more than I've done... Nothing seems to work.
Anyone out there with the same problem? Thanks.

You can try by checking following.
Ensure your console doesn't show any errors and correct them if there are any.
Be sure you didn't disable browser prompts on IE
Try using window.alert() - it's possible (though improbable) that another alert() is conflicting with window's.
If you have console support, try console.log(alert); and see what it says. It should be something like:
function alert() {
[native code]
}

Related

call page function from firefox addon with location.href doesn't work

i try to call a javascript function from the original page from my firefox extension content_script like this:
content_scripts.js
location.href="javascript:tellParent('lightboxClose();'); void 0";
This works very well in my Chrome Extension but doesn't work in my Firefox Addon.
Is there a similar solution or a workaround to call that function from the page?
I'm searching for a solution since hours and can't get it to work.
Hope you can help me
Finaly after hours of searching i found a solution that works for me.
Calling webpage JavaScript methods from browser extension

Twitter feed not displaying in Chrome

I have browsed the web trying to find a solution to this problem, many people have suggested disabling avast plugin, add blocker within chrome extensions yet none of these worked.
the url is https://careers.telstra.com/ you will see half way down next to the facebook feed the twitter feed is empty when using chrome, when I view this in IE, FireFox it displays as I would expect.
I've checked the console log in Firefox and I receive no errors, when I go to chrome on the other hand I see the following:
I personally do not think these are related it any way but I thought I would provide as much information as possible to try and get this fixed.
update Turns out the errors are related to google-cast-sdk instead of silently dumping the errors they have decided to dump them straight in to the console. Read more about it here
I've checked and made sure I'm referencing the correct twitter widget.
We build it as follows as pass it to the page
sb.Append("<div class=\"twitterWidget\"><a class=\"twitter-timeline\" href=\"//twitter.com/telstracareers\" data-widget-id=\"345026269295038465\" data-chrome=\"nofooter noscrollbar transparent\" data-tweet-limit=\"3\">Tweets by #telstracareers</a></div>");
The website runs under https, I have tried the following:
href=\"https://twitter.com/telstracareers\"
href=\"//twitter.com/telstracareers\"
Still have no luck, I'm not sure what else I could try any suggestions?
Thanks

Symfony2 Web Profiler disappeared ajax calling but invalid response in google chrome only

Im just working on a project with symfony2 and yesterday i started to design it.
Not i just noticed that the web profiler is not visible.
I tried everything! it is active in the config_dev, body tags are opened and closed well. The JS Code is loaded just before </body> and the /_wdt request is called, but heres the response:
now just calling myself this url returns the right response. in this case, the toolbar is shown.
I just tried the same with safari and firefox and everything worked well?! So only it is failing with chrome (even in ikognito mode with no plugin).
so it must have something to do with what? i dunno..
and since this time TinymceBundle not works well also. Even if the js code is loaded my textarea with the .tinymce class is not a Tinymce Textarea, Some Js code errors?
Thanks!
I am using Zend Server CE as Environment. Just stopping and Starting the Server fixed the bug?!

Windows Safari Freezes When Silverlight Calls a JavaScript window.alert/prompt

I have a Siverlight application, which needs to get something from the web page that hosts it. So I'm using HtmlPage.Window.Invoke("JS_OpenProject") in Silverlight.
Here is the JavaScript code:
function JS_OpenProject() {
// window.alert also crashes
window.alert("Here is a window.alert");
// window.prompt also crashes
//var result = window.prompt("Please input the id of the project to be opened:", "12345");
return result;
}
Safari freezes every time when the JavaScript method JS_OpenProject is called. If I remove the window.alert and window.prompt, it's fine.
On Windows, I tested my Silverlight application with JavaScript calling against IE, Chrome and Firefox, everything works fine, but just the Safari.
I have googled a lot, but no luck.
Please advise!
Thanks.
Peter
I had the same problem with FireFox and that seems to have been corrected now. The problem arises when Silverlight is run in windowsless mode.
If you don't need it turn it off, it will run even faster.

What might cause an XMLHttpRequest to never change state in Firefox?

I'm working on some old AJAX code, written in the dark dark days before jQuery. Strangely, it has been working fine for years, until today when it suddenly stopped firing its callback. Here's the basic code:
var xml = new XMLHttpRequest(); // only needs to support Firefox
xml.open("GET", myRequestURL, true);
xml.onreadystatechange = function() { alert ('test'); };
xml.send(null);
Checking the Firebug console, the request is being sent with no worries, and it is receiving the correct XML from the request URL, but the onreadystatechange function is not working at all. There's no javascript errors or anything else strange happening in the system.
I wish I could just rewrite everything using jQuery, but I don't have the time right now. What could possibly be causing this problem??
A further update - I've been able to test my code in a different browser (FFx 3.0) and it was working there, so it must be a problem with my browser. I'm running Firefox 3.5b4 on Vista, and I've tried it now with all my addons disabled with no luck. It's still really bugging me because I was working on this site yesterday (with the same browser setup) and there were no problems at all...
Actually I just took a look back in my Addons window and saw that Firebug was still enabled. If I disable Firebug, it works perfectly. If I enable it, it's broken. Firebug version 1.40.a31
is the url malformed?
have you tried putting the whole thing in a try-catch and alerting the errors (if any)
is it failing on an authorization check?
does the url in question require http-auth? (though there should be state changes in this case, I'll admit)
edit:
I have a really funny thought here. Are you using firefox 3.5 beta4? I develop a firefox extension for a browser-based game and recently discovered some odd behvaviour. With my extension or firebug observing the ajax requests made from the page, the script ccreating them would never get calledback. The request would be correctly observed and processed by both firebug and my extension (I could observe what was sent and received)... but the page itself would never hear from the request again -- like it had disappeared into a black hole.
Try turning off firebug (or at least turn off listening to 'Net' for that domain) and test it again
Known Firefox bug affecting Firebug; see http://code.google.com/p/fbug/issues/detail?id=1569&q=xhr&colspec=ID%20Type%20Status%20Owner%20Test%20Summary for details :-)
It seems unlikely that onreadystatechange would stop working. Is it possible that the 'alert' function has somehow been disabled or overridden? Can you replace the alert with some code to make a visible change in the page, and check its functionality that way? (I know, its a stretch, but it just seems so strange that onreadystatechange wouldn't work!)

Categories

Resources