|
hi all,
greetings. I've to detect the pop up blocker status using java script. I'm using the following code, which is taken from a site. But it is not working.can any one of you give me the soltuion for solve this issue.
<br />
function detectPopupBlocker()<br />
{<br />
var test=window.open("","","directories=no,width=100,height=100,menubar=no,resizable=no,scorllbars=no,status=no,titlebar=no,top=0,location=no");<br />
if(!test)<br />
{<br />
test.close();<br />
alert("A popup blocker was detected.");<br />
}<br />
else<br />
{<br />
test.close();<br />
alert("No PopUp Detected");<br />
}<br />
}<br />
Thanks in Advance
babu
|
|
|
|
|
What goes wrong and in which browser?
Brad
Australian
- Captain See Sharp on "Religion"
any half intelligent person can come to the conclusion that pink unicorns do not exist.
|
|
|
|
|
the function does not find for the pop up blocker ON/OFF in my application. Its is IE7.
|
|
|
|
|
Did you remember to call the function onload?
Brad
Australian
- Captain See Sharp on "Religion"
any half intelligent person can come to the conclusion that pink unicorns do not exist.
|
|
|
|
|
yes.I've called in onload
<title>Untitled Page
<asp:linkbutton id="Button1" runat="server" text="Button">
|
|
|
|
|
You do realize that the function is called "detectPopupBlocker"?
Brad
Australian
- Captain See Sharp on "Religion"
any half intelligent person can come to the conclusion that pink unicorns do not exist.
|
|
|
|
|
since i used in the following method, i called up the "testPopUP()"
function testPopUp()
{
detectPopupBlocker();
}
|
|
|
|
|
Try the following script it might work.
<br />
function detectPopupBlocker()<br />
{<br />
var myTest = window.open("about:blank","","directories=no,height=100,width=100,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,top=0,location=no");<br />
if (!myTest)<br />
{<br />
alert("Please allow popups for this web site");<br />
}<br />
else<br />
{<br />
myTest.close();<br />
return;<br />
}<br />
}<br />
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
No.Its not working.its not even executing the if part of teh function.
|
|
|
|
|
You'll also want to remove the marked line, as the window does't exist when that code executes you can't call the close method...
if(!test)
{
test.close();
alert("A popup blocker was detected.");
}
else
{
test.close();
alert("No PopUp Detected");
}
|
|
|
|
|
I did that too.But it is not working.Could you tell any other solution for this issue.
|
|
|
|
|
Standard question #1:
What do you mean by "not working"?
Standard question #2:
What error message do you get?
Have you enabled Javascript error messages in the browser?
---
single minded; short sighted; long gone;
|
|
|
|
|
The code you posted is working fine for me (IE7).
Make sure the site you are using is not:
- In your exception list
- On your local file-system
- On your network and opened with an UNC-path
- on your local IIS (ie localhost)
Wout Louwers
|
|
|
|
|
|
I am designing a web service that should be returning a dataset.
And I am using .NET 2.0
I have a couple of questions regarding that.
1. How should I create the returning datasets? I can add XML Schema files in App_Data or I can add Datasets in App_Code. Which is the most intuitive way, because both have extensions as 'XSD'?
2. Where to keep these files? In App_Code / App_Data or a new folder?
Thanks
Atul
|
|
|
|
|
In general data files should go in the App_Data folder. I would suggest putting them there.
Ben
|
|
|
|
|
Actually these are not Data Files.
They are just schema definitions. They will be filled with data within code and then returned.
Atul
|
|
|
|
|
Right, but you could also put the empty dataset.xml in the App_Data folder as well. Not that you need to, but that is where it would naturally go and since the schema file (xsd) applies to that xml dataset, I would say it logically suggests to put the xsd file in the App_Data folder. Normally the only thing I put into App_Code is BasePage type stuff that all my pages inherit from or some BaseUserControl stuff. I also have some HTTPHandler stuff in that folder. I don't really consider an xsd file code so I would not put it in the App_Code folder. I guess if you had several xsd files perhaps you would want a new folder.
Ben
|
|
|
|
|
XSD files are compiled and therefor one would expect they have to go in App_Code?
I also suspect you'll have difficulty returning a fully fledged data set object through a web service.
|
|
|
|
|
To my knowledge XSD files are not compiled. They are just schema files. They describe the rules for the xml file they are the schema for. In my experience I have not had any issues returning a fully fledged data set through a web service. As far as the web service it is just a dataset. It is your caller and the web service that need to understand what is in the dataset.
Still it sounds like you want to put the xsd in App_Code. In the end it doesn't matter that much. I was just giving you my opinion on where I thought it should go.
Ben
|
|
|
|
|
Hi
How do I add the user "everyone" with full control to the security settings of my web.config file. I need to chane the web.config file via my web service so that I can set my connection string as required per client
Regards
|
|
|
|
|
DON'T !!!
you can use info about the connecting client to construct the connection on the fly in code. But never change web.config from code.
note that changing the connection srting per client makes you loose connection pooling benifits.
|
|
|
|
|
I have to
This is a fire detection server that will be standing behind a firewall and no-one can have access to it from the outside. No one will consume the web service from the outside. However for my technicians to install the system on the mine they need to change the connection string to connect to the database as the path of the data base can change on a per install base
Regards
|
|
|
|
|
I think the web.config is readonly in runtime 'cause the web
application is forces a restart the it detects a changed web.config
file. So either if you can change it I don't think its saved until the
webapp restarts or the web.config is readonly in runtime.
|
|
|
|
|
I wrote and article which describes how to change the web config file programmatically. I think if you follow my article you can created a domain user that you set up as the identity of your app pool that your web service runs under. Then you could change the web.config. NOTE when the web.config is change the application will restart. If you are talking about the web service changing a different web sites web.config that is pretty dangerious, I would suggest a different solution if at all possible.
http://www.codeproject.com/useritems/SingleWebConfigFile.asp[^]
Hope that helps.
Ben
|
|
|
|