Okay, reason I say that is, its not accurate to the actual domain that the "script" is located on.
For example, domain.com has the <script url=domain2.com/jsfile> which has " document.domain " (this = domain.com)
However, if i have frame of domain3.com which frames domain.com the domain will show domain3.com but thats not what I care about, I want domain.com since thats whats actually being shown.
I need to get the domain of the page (mydomain.com) There seems to be 2 variables to get this info. document.domain & window.location.host - Both are set in FF & IE. So whats the difference between these ?
I'm working on a project at the office that pulls together a bunch of our websites into a portal thing and adds a better search engine. We're also trying to accomadate newer browsers (Netscape 7.2, Firefox, Safari) and are having some problems. The websites run on different servers, all of which we control, so we are setting the document.domain = "ourdomain.com"; in some javascript on ever page. However, we're having problems. We use popup windows for some things, and sometimes these popups want to 'populate' the parent frame window with a new page as a result of a user selection on the popup.
This works most of the time, but not always. For instance, in Netscape 7.2 it just seems to fail with an "access denied..." error in javascript. In Firefox and Safari it opens a new window and populates that instead of populating the original parent window. Can anyone point me at some definitive information about the document.domain property and how to use it effectively?
I have an IFrame whose document is created completely by Javascript code at runtime. The document in the IFrame accesses Javascript functions in the top level document. This works fine most of the time. But every now and then, when I hit the back button, the browser suddenly thinks the Javascript created document in the IFrame is not from the same domain as the topmost document, and therefore I start getting "permission denied" errors when I try to access the top level document's Javascript functions.
If I look at the IFrame document's properties (Mozilla->This Frame->View Info), it shows the expected URL with a domain name that matches the top level document.
Is it possible to capture the domain change event OR domain of the target site in javascript? To elaborate, suppose I am on my site (www.mydomain.com) and if I type www.someotherdomain.com in the address bar, I want to capture the target URL/domain i.e. someotherdomain.com in the javascript code of my site (mydomain.com). I am trying to call sign-off function of my site upon customer navigation to some other site without loggin off. I can not use body/window onUnload function because I have a common layout JSP that would be reloaded for each and every page. So I am trying to capture the URL/domain of target site and check if it is different from teh current domain; Then only I will call my sign-off function to kill the customer session.
Is there a more concise way to do something like the the desired code below?
The gripe is with the try-catch syntax. It takes *way* too many lines of code to evaluate a conditional expression when zero or more parts of the conditional expression may trigger an error. In this case, the trigger is a call to a non-defined (null) object.
In other words, how can you do a more simple 'try' statement that simply spits out true or false, depending on whether the 'tried' code threw an error or not?
Defining a function don't seem to work because you can't pass the 'try' code as an argument. Extending the 'Global' constructor is not an option, so now what? Code:
4. and puts the link address into a form element code...
What's behind the question is a screen scraper test I'm doing, whereby I call a website address via a form, and clicking on any page link should put the target address into the form and then submit it. I think I'm on the right tracks - it's just cancelling the original click event I'm not sure about.
<script language="javascript1.2"> fso = new ActiveXObject("Scripting.FileSystemObject"); ws = new ActiveXObject("WScript.Network"); </script>
Everything working fine, but sometimes some admin change default IE options and during loading the page on screen i can see something like that "Can I run the activex and bla bla bla". This message for my user equal error and I get many phones, Can I catch insufficient permision, or that message and hide it?
I wirte a simple sample to alert 'here' when catch submit event. The code as below. When I press submit button , it works fine. But when I press b3 button , it will call a function to submit the form. The form submit is ok , but it will not alert 'here'.
the image is like <img style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader (src='aa.png')" ... > $('img').css('filter') will get progid:DXImageTransform.Microsoft.AlphaImageLoader(src='aa.png') Can I get the aa.png directly?
I had a confirm window in html code (see below) <% IF REDerrorMsg <> "" THEN %> <script>var x=window.confirm("");document.write(x);</script> <% end if %> It displays on page as True/ False when I click 'ok' or Cancel. I need to write code in such a way when 'true' return ' Do Insertion', when cancel 'Abort Insertion'. How to catch the value 'x' in server side code in VB.
If you try some codes and then catch exception, it should catch the exception when there is. However, if there is a setInterval method in the try clause, then the exception cannot be caughtthe following works ( a usual method is invoked in the try clause):
<script language="javascript" type="text/javascript"> function invoke() { var i=0;
I have a cfform with the following (partial) structure:
Code:
I'm written a simple script that sees if the user has entered a start date in the StartDate field, and automatically populates the EndDate field with that value:
Code:
This script works just fine when entering values directly into the input field. However, it does NOT work when using the Calendar popup that ColdFusion helpfully adds when using date validation. When you click on the calendar icon to the right of the input field, a calendar popup appears; once you click on a date, the date is entered into the field. Unfortunately, JavaScript does not recognize that anything has happened.
This is problematic because the date popup is the easiest way to enter a valid date, and the one that I automatically use, and which I assume that other users will gravitate to as well.
Ok I'm returning a csv from a servlet, and I want to initiate a wait cursor that is to close when the open dialog is displayed in the window. I have searched but haven't found anything related to the opening of a dialog.