The following code works fine in Firefox but not in chrome (In chrome it only opens the first item)
It's supposed to open all checked links in a new tab. Any suggestions?
jQuery(document).ready(function(){
jQuery("#open_in_new_tab").click(function(){
jQuery("#sales_order_grid_table input:checked").each(function(index){
var $href=jQuery(this).parent().parent().attr("title");
window.open($href);
});
});
});
Related
I have the following link that when clicked, opens a new tab and refreshes the page with the link in.
It works fine in Safari and Chrome but opens duplicate tabs in Firefox.
Run Letters
function openWindowReload(link) {
var href = link.href;
window.open(href,'_blank');
location.href = 'index.php' + "?welcome_letters=export&welcome_letters=export"
}
Any ideas why Firefox is doing this and how to resolve it?
I think it's because you don't stop the default behavior.
Could you call preventDefault on the click event?
This is kind of strange issue i am facing, below is my simple code
<script type="text/javascript">
function openMyWindow() {
var formid=document.getElementById('myForm');
window.open('https://test.com','POPUPWINDO','left=443,top=107,width=650,height=650,location=0,toolbar=0,statusbar=0,menubar=0,scrollbars=0,resizable=0');
formid.method = 'post';
formid.target = 'myWindow';
formid.action = 'https://test.com';
formid.submit()
}
this is working in my local ie11 and chrome. Server chrome it is working however IE11 it is not working. Tried almost everything . I debugged this code using ie debugger found that one window opens at window.open and another Tab opens at submit()
I am developing an application with ASP.net and VB.net. In that application i have written this simple javascript function in the popup window in order to refresh the parent window when the popup is closed.
function RefreshParent() {
if (window.opener != null && !window.opener.closed) {
window.opener.location.reload();
}
}
window.onbeforeunload = RefreshParent;
This was working fine. But suddenly it stopped working. Its still working on Firefox and internet explorer.
its not just a problem in my PC. I am getting this problem from every user who is using chrome to access the application.
The function was working fine. Its just stopped working suddenly. And I can assure that there was no such changes been made which might cause this happen. Its still working on Firefox and IE
But i Have tried the following to see if the problem is related with chrome settings
to see if the javascript is enable or not I double checked the content settings section in advance setting of the browser. Allow all site to run Javascript option is selected.
And I have also re installed chrome.
According to the suggestion of Jeremy I have added two alerts in the javascript function to see if the function is accessed or not.
function RefreshParent() {
alert("Accessed the function!");
if (window.opener != null && !window.opener.closed) {
window.opener.location.reload();
}
}
alert("refreshed parent window!");
window.onbeforeunload = RefreshParent;
I can only see the 2nd alert. But this alert comes when i click to open the popup.
Also when I add this two alert the refreshing function also stops working in firefox (I did not checked in ie with the alert on.)
How to solve the problem
The following solution works for me. In POPUP.vb.aspx POPUP page I added the following line of code under button click
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "refresh", "var url = window.opener.location.href; window.opener.location.href = url;", True)
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "CloseWindowScript", "window.close();", True)
I still have the javascript function ( mentioned in the question) in the asp.net page. Its not clear why its suddenly just stopped working in Chrome.
when I am trying to close fancybox from Ifarame child
using JavaScript "parent.$.fancybox.close();"
in IE it is working
but in chrome + Firefox doesn't working
also try the following command too
" parent.$.fn.fancybox.close();
parent.$.fancybox.close();
//$.fancybox.close()
//window.close();
// parent.jQuery.fn.fancybox.close();
// window.parent.$.fancybox.close();"
and nothing works
I have a issue in ExtJS form. When select a radio button on my form then on focus event not executed in all browsers.
Like everything work almost fine in Firefox (Mac) but nothing works on Google Chrome (Mac).
I am not tested my ExtJS from in a PC only in Mac.
Sometimes in Firefox everything not work correctly on all browser loads.
Here is some source code about functions which not always work fine:
Radio1.on('focus', function(){
//alert('test1');
Ext.getCmp('combo1').enable();
Ext.getCmp('combo2').disable();
Ext.getCmp('option3').disable();
Ext.getCmp('option4').disable();
Ext.getCmp('option5').disable();
Ext.getCmp('option6').disable();
Ext.getCmp('option7').disable();
Ext.getCmp('option8').disable();
Ext.getCmp('option9').disable();
Ext.getCmp('option10').disable();
});
Radio2.on('focus', function(){
//alert('test2');
Ext.getCmp('combo1').disable();
Ext.getCmp('combo2').enable();
Ext.getCmp('option3').enable();
Ext.getCmp('option4').enable();
Ext.getCmp('option5').enable();
Ext.getCmp('option6').enable();
Ext.getCmp('option7').enable();
Ext.getCmp('option8').enable();
Ext.getCmp('option9').enable();
Ext.getCmp('option10').enable();
});
How to fix code? Any ideas?