The code i used in the javascript to close the window is as follows
window.open('','_self','');
window.close();
in jsp
Close
it's not working in chrome version 36.0.1985.143, it worked in previous chrome version, IE and in FF also. How can i fix it.
Please help me.
Thanks in advance.
The chrome latest release has changed that functionlity as there has been several security issues because of that. You need to try like this:
chrome.windows.remove(integer windowId, function callback)
You can check here
Related
My Code:-
<BODY onload="redireccionar();">
<SCRIPT LANGUAGE="JavaScript">
function redireccionar() {
setTimeout("self.close()", 500);
}
</SCRIPT>
Above is my code regarding facing issues on chrome and firefox while it works fine with IE. I have tried almost all functions available here but still facing the same.
please suggest any solution. Thanks in advance.
I searched everywhere and found out that you have to trick the browser into thinking it was opened w/JavaScript. This worked for me in Firefox and IE:
Close this window
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.
I am running the following JavaScript Bookmarklet code in Chrome and it's running perfectly fine. However, only a blank window opens when I try the same code in IE.
javascript:var str=document.documentElement.innerHTML;
var find='</textarea>';var re=RegExp(find,'g');str=str.replace(re,"</OMG>");
var cmrform = document.createElement("form");cmrform.target="CMRWindow";cmrform.method="POST";
cmrform.action="http://localhost:8080/cmr/CMRTool.jsp";
var srcInput=document.createElement("input");srcInput.type="text";srcInput.name="sourceCode";srcInput.value=str;cmrform.appendChild(srcInput);CMRWindow=window.open("","CMRWindow","status=0,title=0,height=600,width=800,scrollbars=1");cmrform.submit();
Can someone please guide me why this code is not working in IE.
Thanks In Advance :)
Use document.forms instead of cmrform:
document.forms[document.forms.length - 1].submit();
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
Yesterday I added a line of JavaScript that uses confirm(), and I was using FireFox 3.6.3 and it was working fine, but today FireFox upgrades to 3.6.4 in the background and the confirm() freezes my browser, although it still works in IE. I suspect it is a FireFox 3.6.4 issue.
I was wondering if that was indeed a FireFox 3.6.4 issue. If anyone could please let me know, that would be great.
Thank you very much,
Rudy
confirm() works as expected here (FF3.6.4 US-en)
I'm don't see any similar issues in Bugzilla, so it's likely that this is not an issue with confirm() itself but, rather with how you're using it.
Can you create a simple, stand-alone test case that reproduces the problem and post it to http://pastie.org so others can test it? If people are able to reproduce it, than it should be submitted as to Bugzilla.