473,396 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to open up a pop up window

Hello everyone,

I want to open pop up window through jquery.
My jquery code is as follows:

jQuery.ajax({
url: "/signUp/twit",
type: "post",
data: "ajax=true&twitterid=" + jQuery("#profileTab #twitterid").val()",
success: function(response,status){

alert(1);
}
});
here inside success call back i want to open pop up window on some specific response.
Could someone give me an idea how to do that.And is it possible to use window.open()javascript function in jquery to open new pop up window.Because as per my knowledge we can use js functions insside jquery,but window.open() not working.


Thanks
Oct 10 '10 #1
7 2627
kovik
1,044 Expert 1GB
window.open() should work fine unless you are not giving it a valid URL to open. Show us the code that you were using to open the window.

By the way, this doesn't belong in the PHP forum.
Oct 10 '10 #2
Thank you kovik, And sorry to post this question on this forum but I just asked it because I am using jquery with php.

Thanks one more time.
Oct 11 '10 #3
hi kovik,

here is my code:

if(jQuery("#profileTab #twitterid").val() != "")
{
alert(jQuery("#profileTab #twitterid").val() ); jQuery.ajax({
url: "/signUp/twit",
type: "POST",
// data: "ajax=true&twitterid=" + jQuery("#profileTab #twitterid").val()",
success: function(response,status){
alert(response);
if(response == 1)
{
window.open("http://www.google.co.in/","Twitter","width=650,height=500,resizable=yes,sc rollbars=yes,toolbar=yes,location=yes, status=yes,directories=yes,menubar=yes");

}



}
});

}

here every thing works fine only the pop window is not opening up by window.open();

Morever when I uncomment the data section inside ajax call nothing will happen even a single alert is not working.

Please help me if possible as soon as possible I get stuck here.

Thanks
Oct 11 '10 #4
kovik
1,044 Expert 1GB
Firstly, use [code] tags when posting code.

Secondly, the problem with the data is that you have a stray quotation mark at the end of that line. Your browser's console would be able to tell you that.

Thirdly, your window.open code looks fine. Have you tried using it without jQuery to confirm that the issue is jQuery? My guess is that your browser's pop-up blocker is stopping your window from showing.
Oct 11 '10 #5
Thank you Kovik, Nice explanation.
My Issues has been fixed up now.

Thank you
Oct 12 '10 #6
kovik
1,044 Expert 1GB
Was it the pop-up blocker? Did I call it or what?! :D
Oct 12 '10 #7
yes Kovik, it was pop Up blocker that had been blocked.
Oct 12 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: John | last post by:
HI, I was wondering if it is possible to target a named anchor in a frame when opening a new window with a javascript function? has anyone actualy been able to do this? Thanks in advance for...
10
by: -DRB- | last post by:
Hi all, I'm very much an amateur designing a page (for free!) for a friend, so any help offered would be hugely appreciated. I'm aiming to open a maximised window (and isn't that fun...) and...
3
by: Robert Atkinson | last post by:
Does anyone know how to replace <a href="url" target="_blank"> with window.open, keeping the window settings the same, i.e. same size, same toolbars, etc. I've tried document.open, and...
2
by: Daniele Baroncelli | last post by:
Hi guys, I am trying to find out how to position an opening window in Internet Explorer. While in Netscape/Mozilla/Firefox exist the options screenX and screenY for the open method of the...
7
by: mg | last post by:
Once opening WebForm2 from WebForm1 using Response.Write("<script language='javascript'>window.open ('WebForm2.aspx','two','menubar=no');</script>"); how can I close WebForm1?
7
by: mg | last post by:
I need to first open WebForm2 from WebForm1 and then close WebForm1 without the end user having to press an OK button before the close can occur. For example, possibly ...
6
by: SkeanDu | last post by:
Ok, here is my problem. I have an aspx page that displays a databound datagrid and in one of the datagrid column headers I have an image that when clicked opens up a modal web dialog (another...
5
by: Roger Withnell | last post by:
This is a framed webpage with the navigation bar in "NavBar" and the main window in "Main". When opening a new page in "Main" from "NavBar" with: function OpenFrameWindow(src) { var...
2
by: Joe Sent Me | last post by:
I have opened a new window and now want to change something in the newly opened window. I am doing this....... <area...
1
by: deararuns | last post by:
i hav a window wit a button and text box.. Then am opening a new window... suppose if i type somethin in a first window's text box.. and click the button.. the value typed in the text box shoult...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.