Detecting Domain Name Change

Jul 23, 2005

Say I'm on the site www.xyz.com and on a certain page if the user leaves the domain xyz.com, I have a popup cme up w/ stuff. I don't need to know what the new domain is, I just want to know if the user left / is leaving xyz.com.

View 1 Replies


ADVERTISEMENT

Capturing Domain Change Event OR Domain Of The Target URL

Jun 7, 2009

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.

View 2 Replies View Related

JQuery :: Detecting Change To A Textarea When Change Not Initiated By User?

Jul 11, 2010

I'm using a text area to display textual updates to a user from the server. I'm inserting the text at the bottom of the textarea and need to set the scrollbar to the bottom of the textarea after every update. The problem is that the onChange event only fires if the user actually changes something in the text area, not if it is changed by an ajax update.Does anyone know of a way to detect if there has been an update to a textarea that was NOT triggered by a user?

View 2 Replies View Related

Detecting Change In Textarea

Jul 23, 2005

I am trying to detect whether a user entered text in a textarea
or hit the delete/backspace button (thus, erasing something). Once
that is detected, I would like to set "var bSaveRequired = true;". It
would be great if this function worked cross-browser -- IE 6.0 and
Firefox.

View 1 Replies View Related

Detecting Change Before Blur?

Jun 16, 2010

I have an input field where users can input a number, and JavaScript calculates a result and displays it on the page. In order to have the best user experience, I want JavaScript to perform the calculation whenever the number in the field is changed. However, the "change" event works only when the input loses focus.

I have added "keyup" as a second event for the calculation to be performed, which covers many cases of user input. However, this is still not perfect, because the user could paste a value into the box or change the value in some other way (i.e. clicking the up and down arrows on compatible browsers).

Is there an event that fires whenever the value in the input changes, regardless of the focus of the input? Is there some other way to work around this problem? It seems like this would be the kind of thing that would have a thousand hits on Google, but I can't seem to find anything.

My code:

Code JavaScript:
function onLoadFunc(){
if(document.addEventListener){
document.getElementById("wm_buy_amt_input").addEventListener("keyup",

[Code]....

View 3 Replies View Related

JQuery :: Detecting When LI Element Class Change

Jul 15, 2010

I am trying to change to change the background of a li element when its own class is changing
i tried :
$("ul#slide-nav li").each(function() {
if ( $(this).hasClass("selected") ){
$(this).css("background-color","black");
}else{
$(this).css("background-color","gray");
}});
This seems to be working I think., but once the class change again it doesn't work.. how can it loop for ever?

View 5 Replies View Related

Change The Domain, Keep The Path..with Javascript?

May 25, 2007

I'm currently at http://www.domain.com/the-path.jsp, and I would like
to be able, with JavaScript--and possibly the click of a button, which
I will most likely attach to IE's toolbar--transport to
http://domain.dev.domain.com/the-path.jsp.

Here's the environment: My browser is set to the page http://www.domain.com/the-path.jsp
and I plan to add a button to IE's toolbar via the registry that I
would like to execute the JavaScript, which contain the code to
perform the aforementioned procedure.

My JavaScript knowledge is, as I'm sure you've already surmised,
limited.

Here's what I know (or what I think I know)

The .js file header:
oShell= new
ActiveXObject("WScript.Shell");

the object: window.location.replace [or href].

I have a feeling a "and if" statement is needed here. Am I correct?

BTW: As far as the registry button addition is concerned, I'm set on
how to do that.

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

JQuery :: Cross-Domain - Send Data Through POST To Other Domain

Oct 28, 2011

I need to send data through POST to other domain.

My script is:

But I am still getting the error XMLHttpRequest cannot load [url]. Origin [url] is not allowed by Access-Control-Allow-Origin.

XHR finished loading

I set in the destination

I don't know why it dosen't work.

View 2 Replies View Related

AJAX :: Cross Domain Post - Post Data From A Form To A Page On Another Domain, Without Leaving The Current Page?

Jan 15, 2010

i need to post data from a form to a page on another domain, without leaving the current page.I am using ASP as a server language.

View 9 Replies View Related

Detecting Tab Key

Jul 20, 2005

I'm trying to use JS to move the cursor from my user login text field
to the password text field - I've put the onKeyPress() event in the
user input tag but then I press the Tab key the cursor doesn't move -

function detect_tab_key()
{
var key_code = window.event.keyCode;
if (key_code == 9)
{
document.forms[0].frm_password.focus();
document.forms[0].frm_password.select();
}
}

View 1 Replies View Related

Detecting Tds Of A Certain Table?

Jun 26, 2009

I would to change the color of some td cells if there is text in it. Right now this code does the job, but it changes the color of evry table. I'd like to know a way to do this on one table in my page and not all of them.

var count='0';
var TDs=document.getElementsByTagName('td')
var length=TDs.length;
i='0';

[Code]....

View 3 Replies View Related

Detecting Which Key Was Pressed

Oct 1, 2007

example: onkeypress="return eventHandlerFunction(event)"

Why is it that you need the return keyword?
Where does the argument event come from?

I know it works, I just want to know why it works.

I've been looking at some refferences and can't seem to find an answer if someone could give me an explanation or point me to a website, that would be great.

View 2 Replies View Related

Detecting Buttons

Oct 5, 2007

I am trying to do something I thought would be simple in javascript, and I'm at a loss. First code is GOOD code, except that it does not account for the possibility that the button(s) in question do NOT exist. The second and third subsets are two of several attempts to do just that. Code:

View 2 Replies View Related

Detecting When A Swf Is Clicked On?

Jan 5, 2010

Is there any way javascript can know when a swf is clicked on?

View 1 Replies View Related

Detecting Flash

Mar 26, 2001

I need to write a script that detects if a person has flash installed and if they do then do something, if not do something else.

I can do this no problem with javascript - except for the detecting flash part. I have no idea how to have a js detect flash - or even if its possible.

View 13 Replies View Related

Detecting It Is English Or Not

Apr 18, 2007

I like to detect whether the basic language of the client browser(O/S) is English or not .

The following would-be code doesn't work correctly, but it will show what I want. Code:

would-be code

<if it is English>

send to English version page

<else>

send to my mother tongue version page

</if>

View 1 Replies View Related

Detecting The Height Of A Div?

Mar 9, 2011

I have a dynamic web page with three vertical divs.

In the style attribute, I do not specify the div height because I don't know that until they're draw by the browser.

However, I'd like to add a fouth horizontal div acfross the bottom of the page at the bottom of the tallest of the vertical divs.

Is there any way to get the height of a div after it's drawn?

View 7 Replies View Related

Get Domain From URL

Aug 4, 2009

How do i get the domain from a URL ?

Some domains are ( com co.uk us gov ie net org ) so all I need is the domain itself.

So far all i can get is the hostname and domain...

View 8 Replies View Related

IE Not Detecting OnChange Properly

Jul 23, 2005

If I detect an empty textbox, I fill it with a value ('Dad'). If I do this twice, the second time around IE 6 fails to notice that I've cleared the textbox again, thus leaving the textbox cleared. Is there a recommended workaround? Opera 7.23 is detecting the second deletion fine.

View 3 Replies View Related

Detecting 64-bit Windows Client

Jul 23, 2005

Can I rely on the following code to accurately detect a Windows 64-bit client?

var bWin64 = navigator.platform=="win64";

View 1 Replies View Related

Detecting Stop Button

Mar 6, 2006

I'm trying to determine if the user clicks the
stop button during a post send, basically. Specifically, if a user is
uploading a file to my server, and they click stop at some point, I
need to be able to tell the server that stop was clicked, so it doesn't
think that's the whole file. I've noticed that an error message is
written to the Apache log, but that seems like a strange way to keep
track of user-interrupted events. (Note: this is Apache/mod_perl
server-side)

I guess what I'm thinking now is that JavaScript detects the stop
(since it is client-side), then sends a message to the server that an
error occurred, or something. Like I said, the onstop event is not
doing what I'm expecting, and Firefox doesn't like it anyway, not to
metion the other browsers out there. So my question is what's the
"idiom" or "standard way" of detecting this sort of situation. I'm
quite certain I'm not the first one to need it.

View 7 Replies View Related

Detecting User's Language?

Jul 11, 2006

If I want to detect a user's language, so that I can
change some text to suit them, how do I do that in
Javascript?

Or aren't modern browsers supposed to be able
to cope with more than one language on a page,
separated somehow by language identifiers,
and display only the appropriate text? Maybe
I was dreaming when I read that.

View 6 Replies View Related

Detecting Dynamic Page Changes

Apr 7, 2007

I'd like to be able to detect when page content is dynamically changed
by Javascript. I'd like to detect any changes to the content, such as
the addition of new DOM elements and when DOM elements that are hidden
are made visible (or vice versa). I will have no advance knowledge of
the scripts that will be run along with the script I will create.

I've implemented a solution that works reasonably well, but I'm not
sure if there are cases I'm not thinking of where it will fail, or if
there are more efficient means of doing the same thing.

My solution is to simply retrieve and periodically compare the content
of the innerHTML property of the main body tag elemnt.

So, summarized as follows:

function check() {
var bodyContent = document.getElementsByTagName('body')[0];
if(bodyContent != oldBodyContent) {
alert('body changed');
}
setTimeout(check, 500);
}

Is there a better way? What won't this catch?

View 1 Replies View Related

Detecting Htaccess Security

Oct 5, 2007

I am writing a script that uses xmlhttp.open, when i attempt to open a protected page I get the login prompt for my htpasswd. Is it possible to detect if there is a login requirement before the login prompt and if there is a login just do something else? I can use xmlhttp.status and check for 200 but if I do this then it would happen after the login prompt.

View 1 Replies View Related

Detecting The Protocol Of A Link

Jul 20, 2005

I'm making an Intranet site for someone who is not very familiar wit
making websites, thus I would like to make it as simple as possible fo
her when she needs to update it.

The intranet site uses frames - one menu frame that is always present
and one frame into which the content is loaded. The intranet sit
features many, many links to both internal and external pages - i
internal pages within the intranet and external pages on the interne
(http://)

What I would like to do is make it so that if a link is internal, th
content will load into the content frame and the menu frame will remai
at the side, but if the link is external, it will load the target int
the entire browser window. Using HTML, this would simply be a matter o
stating the href and then target="content_frame" for internal pages o
target="_top" for external pages.

But, like I said, I am making this site for someone who is not familia
with linking targets and even if I told her to define the targe
whenever she makes a link, she'd probably forget or get confused an
then wonder why external pages are loading with the intranet menu fram
still present or why intranet pages are loading with no menu at th
side!

While I have good experience with HTML, I am fairly new to JavaScript
which is why I am here asking for help.

I understand that Javascript can detect the protocol of a link,
believe you would use "link.protocol". In basic terms, what I woul
like to do is:

if link.protocol = "http://" then target="_top" els
target="content_frame"

But since I'm not familiar with the precise way of coding JavaScript,
would just like some help with transforming this into correc
JavaScript code so that it will work.

View 1 Replies View Related







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