Document.domain Or Window.location.host ?

Mar 3, 2009

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 ?

View 1 Replies


ADVERTISEMENT

JQuery :: $.url() Function - Being Utilized For Parsing Out The Window.location Or Window.location.search Parameters

Feb 14, 2010

Danged if I can find the thread, but I swear I saw a $.url() reference in here a day or two ago. It was beingutilized for parsing out the window.location or window.location.search parameters. I made a mental note because that was something I would be needing to do.

Now I can't find it, either because the search isn't finding it or I was dreaming about this function existing.

I rummaged about the API docs and didn't find it there either. Is it something provided by one of the plugins and not a function native to jQuery?

View 3 Replies View Related

Document.domain - Not Accurate ?

Jul 28, 2011

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.

View 6 Replies View Related

Document.location.href Or Document.URL

Dec 18, 2002

Which is the better option to use when dynamically loading a page?

document.location.href = "newpage.html"

or

document.URL = "newpage.html"

My book says that Netscape depreciated document.location.href in favour of document.URL, but yahoo are using document.location.href. Also, is there a good online reference (up-to-date) of the DOM which includes stuff like this?

View 6 Replies View Related

Catch Invalid Document.domain Set ?

Mar 23, 2010

I do my development on a local PC before putting the code onto a website.

Something I need to do is set the document.domain to the top level domain for a page. The top level domain will be supplied via config item.

The small issue is that my top level domain when developing is "mypc" and attempting to set document.domain to "mypc" kills the javascript.

I tried this as a work around:

Code:

But this still triggers a complete failure of javascript on the page. I also tried using eval to do it, but it still kills things.

It there another trick to try setting the domain without dieing that doesn't involve validating the domain string before attempting to set it?

[Edit] I am aware that it's dieing because "mypc" is clearly not a FQDN as it expects.

View 4 Replies View Related

Document.domain Issues And Cross Server Scripting

Jul 23, 2005

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?

View 1 Replies View Related

Javascript Created IFrame Document, Weird Domain Issue

Aug 3, 2005

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.

View 2 Replies View Related

Document.location

Jun 28, 2002

or is it window.location?

anyway, why doesn't this work?

Any ideas why this doesn't work?

<script language="javascript">

function goclaims()
{
document.location.replace = "../webapplication2/webform1.aspx";
}
</script>

<asp:ImageButton onlick="goclaims();" id="Image5" onmouseover="this.className='applyBorder'" onmouseout="this.className='removeBorder'" runat="server" Width="24px" Height="18px" ImageUrl="file:///C:Documents and SettingsgregbDesktopiconsClaims.ico" CssClass="removeBorder"></asp:ImageButton>

View 3 Replies View Related

Passing/using Document Location

Aug 5, 2009

Im currently creating a Table with 2 frames (table in top, last row clicked in bottom)

<html>
<frameset rows = "60%, 40%">
<frame src = "table_driver.php" name = "A" id = "FRAME1">
<frame src = "bottom_row.php" name = "B" id = "FRAME2">
</frameset>
</html>

In bottom_row.php I have one object, a [obj = new TableData()]. onClick of a row in FRAME1, obj is initialized to what was clicked and the row is changed.

anyways currently I have it working but want it such that it can work with multiple frames, with a location parameter.

this is currently what I have

function TableData(headers, row, loc)
{
this.headerArr = headers;
this.rowArr = row;

[Code]....

View 2 Replies View Related

Document Location During Runtime

Aug 19, 2003

I'd like to find the document location during runtime for a script I'm using, and having next to no experience with JavaScript, I don't know how.

For example, if my document is local:
http://localhost/websites/example/script.js

If my site is live:
http://www.example.com/script.js

How can I extract everything but the script name and put it in a variable?

View 2 Replies View Related

Document.location Not Working?

Feb 18, 2010

I have been trying to get the code below working for 9 hours now. Finally, I decided to test the same code on another sever, and it works fine! I have no idea why the same code would work on one server, but not another.

The code is self-explanatory, I created a button that when clicked will navigate the user to a link (#hit1).

Code:
<script type="text/javascript" language="javascript">
function firstHit(){
document.location="#hit1";

[Code]....

View 3 Replies View Related

View-source:'+document.location'

Jul 20, 2005

This will give me the source of the current page.

<a herf="javascript:document.location = 'view-source:'+document.location">testpage.htm</a>

I want to display the source of another page, using something like this but it doesn't work:

<a herf="javascript:document.location = 'view-source:'+'testpage.htm'>testpage.htm</a>

?? Won't work, unless it is saved on a server with http:// in front of it.

View 5 Replies View Related

Accesskey & Document.location.href

Dec 7, 2006

Is there any way to get 'accesskey' to work with document.location.href?

I'm using a set of functions as link generators and this is what I'm "stuck with" using.

View 3 Replies View Related

Enter Key Won't Send To Document.location?

Mar 28, 2011

The code below will enter the function when enter key is pressed, and will activate the alerts but will not send to the new page using document.location

the onclick calls the function and sends to the new page?

<script language="javascript">
var ZIPS ="07071";
var ZIPS2 ="07960";
var zipArray = ZIPS.split("/");

[Code]....

View 8 Replies View Related

Trouble Retrieving Window Location From A Previously Opened Window ?

Dec 24, 2005

I am trying to open up a new window and then get the current url/location
back from the (win_1) window and display the url in an alert box.

Here is the code I am using :-

<script type="text/javascript">
var mywin_1 = open ("http://www.anysite.com/index.htm", "win_1",
"height=640, width=820, left=200, top=0, scrollbars, status, location");
var temp = mywin_1.location;
alert (temp);
</script>

Where am I going wrong?

View 2 Replies View Related

Window.opener.location - Set The Parent Window(main Browser)

Nov 13, 2011

I'm using window.showModalDialog but having an issue trying to set the parent window(main browser). I open modal window A which is then opens modal window B, top of modal window B onload I do window.opener.close()". My issue now is when i'm finished with B I set parent window(main browser) to a new url with window.opener.location. So my problem is modal window A the parent has been closed so window.opener.location will not work.

View 3 Replies View Related

Document.write Writing To A Specific Division Or Location

Jul 23, 2005

In searching answers to my quest, I have been looking for a method using
document.write to display the thumbnails in one division while showing text
about the thumbs in another division.

All I've seen so far is that document.write('does this') and that's it.
Nobody expands on this and explains what else you can do with it.
It's like they're more interested in showing you the ads than the
information you need.

View 2 Replies View Related

Document.location.reload(false) Fails To Go To #anchor

Aug 5, 2011

Code:
<a name="loc"></a>
<a href="#loc" onClick="document.location.href='#loc'
document.location.reload(false);return false">Click here to go to your location</a>

When you click onto the link you should go to the page location marked by the anchor tag "loc", however, upon clicking you go to the top of the page and never redirected to the exact spot where your anchor tag is located. Why is that? I'm using IE6 (per requirement) as my platform.

View 9 Replies View Related

Window.opener.refresh On Other Domain

Jun 22, 2006

I know Window.opener.refresh() does not work if two windows are from a
different domain.

Anyone a (javascript)-solution for this problem?

View 3 Replies View Related

Cross Domain Popup Window

Feb 10, 2005

I am trying to send values from a popup window to the parent window. The opener.parent event does not work in my case, as, my popup window is in a different domain. Code:

View 4 Replies View Related

JQuery :: Using Document.location.href To Direct To A Non-existant Page

Oct 14, 2011

I'm trying to create a player stats page, for my gaming server. I spoke to a guy who knows a little about javascript, and he told me there's a way to use document.location.href to direct to a custom page URL.

For example, if I search for a name, and the results are displayed. I want to click the players username, and be directed to. [url] without the "username.html" actually existing.

I heard it's possible, and it would save me a lot of time because I don't want to have 20,000+ individual pages, one for each username.

View 1 Replies View Related

Changing Document.location.hash In IE7 Overrides Event.stop(e) And Submits Form

Jul 7, 2009

I am writing a modification to Invision Power Board that makes replying to post via Ajax.

The "Submit" button is being overrun by Prototype's observe function. When the custom function is executed, I run Event.stop(e) to prevent the actual form from being submitted and reload the page.

I have developed and tested on Safari but users began to report bugs in IE, after investigation I discovered that the line

Code:

Is making IE execute all the code after it, and then execute its own onclick() function as if Event.stop(e) was not there. Commenting this line fixes the problem, the page is not reloaded, but this line is vital to the code.

So why do I need to set the anchor? To support the back button function after a user makes an ajax reply, pressing Back should hide the new content, and pressing Forward should make it visible. (e.g. every time the anchor is changed) This all works nicely. But not in IE.

This only happens the first time the page is visited ever, or clearing cache and visiting it again. Reloading the page fixes the problem but this is not normal behavior and users shouldn't have to reload to use the Ajax fast reply...

View 4 Replies View Related

Building The Document In A New Window Entirely With Document.write

Apr 22, 2006

I am working on creating a document where you check a bunch of checkboxes to select what to include, then click on a button. A function then opens a new window and writes the HTML code to run scripts in .js files to populate the page. Code:

View 4 Replies View Related

Closing The Iframe Window Of Main Domain Which Is Opened From Subdomain?

Apr 12, 2010

I have problem with closing the Iframe of main domain window and this window is opened from the subdomain.

For eg: I have www.example.com , which has a page sendto.aspx and I open it in Iframe from subdomain sps.example.com.

This Iframe is not closing if I say self.close(), window.close(), window.parent.close() and nothing works for me.

I also checked that the current domain is example.com when I try to alert with document.domain.

View 1 Replies View Related

Godaddy Domain Search Script - Doesn't Open In A New Window

Sep 20, 2009

Ok after much research I have created a script that will search godaddy for domains using javascript. Now the problem is that it doesn't open in a new window when you click search. How do I get the script to open the godaddy results in a new window? btw target="_blank" isn't working.

CODE:
<form onsubmit="var loc='http://www.godaddy.com/gdshop/registrar/search.asp?domainToCheck='+this.elements[0].value+'/';location.href=loc;return false" method="post" action="" target="_blank">
<input name="query" size="38" style="border: 1px solid rgb(126, 157, 185);" value="" type="text">
<input name="Submit2" value="Search" id="Submit2" type="submit">
</form>

View 2 Replies View Related

JQuery :: .support.cors = True Only Allow Certain Domain - Load The Exact Same Json Data From Other Domain Or Localhost

Jan 4, 2012

I am doing some development using jQuery $.getJson lately and found the following weird scenario.

1. open google chrome without any argument then load a local html file.

2. the local html file will need to have $.getJson[url] .... bla bla bla and jQuery.support.cors = true.

3. data will get loaded

But if you try to load the exact same json data from other domain or localhost, it wouldn't works.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved