Using Javascript To Determine The Correct URL
Nov 16, 2005
I want to create a link to an email conference which is on 2 servers. Some users will only be registered on server1 and others will be registered on server2. however I don't know which users are on which server.
Is it possible to create some kind of JavaScript function which attempts to open a link to server1 and then if this fails default to server2. It would be far more user friendly.
View 4 Replies
ADVERTISEMENT
Mar 24, 2011
i have a website with content on specific pages i need some sort of JS soloution which will fetch an ID/Keyword out of the page content so when a button is clicked it finds the ID/keyword and directs the user to a specific form/page.
View 1 Replies
View Related
Feb 24, 2011
I have several checkboxes in a switch statement like the one below:
How can I use a continue button to determine which checkbox was clicked and redirect me to the correct page?
View 2 Replies
View Related
Apr 4, 2003
I tried searching in the forums for this, but the search function keeps saying I can't search on less then 3 keywords? (I used the string in the subject!) Anyway... is this possible? I want to determine if JS is enabled, and display a "you must enable javascript to continue" if not.
View 3 Replies
View Related
May 31, 2005
I call methods in a Java applet with javascript code like this:
document.myApplet.methodName();
This works great when the applet has loaded (the JVM has started and dowloaded all the jars) but it fails if the applet hasn't loaded yet, at which point it gives an error:
Quote:
Error: Object doesn't support this property or method
Is there a way to determine that the applet is loaded or not so that I can use it in an if statement? For instance, like so:
Code:
if (isAppletLoaded()) {
document.myApplet.methodName();
}
I tried
Code:
document.myApplet == null
but that didn't work.
View 3 Replies
View Related
Nov 12, 2006
Im trying to find the correct syntax to use to determine whether which form
element is visible on changing the value in a dropdown list
I need something in the onChange of the dropdown list that will cause the
appropriate element on another part of the page to be displayed Code:
var mydropdownlist =
document.questform.typeid.options[document.questform.typeid.selectedIndex].v
alue;
if(mydropdownlist<6)
then display <input name="ans1" type="text" >
else
display <textarea name="ans1" rows="1" ></textarea>
View 5 Replies
View Related
Jul 20, 2005
I'm new to javascript and PHP and I am wondering if there is a method or function to capture a 404 error in the event a particular html file cannot be found. I want to redirect that error to another page or design the code to send me an email telling me what page was selected and not found. In other languages I can trap such an error and respond to it.
View 3 Replies
View Related
Dec 29, 2009
I wrote a simple code in javascript and it is working fine with IE and Firefox but the out put in php array count is correct in IE but not correct in Firefox
<script language="javascript">
var arrdimensions = {
"codimesion":{"s":{'0':'dimesion1','1':'dimesion2','2':'dimesion3','3':'dimesion4','4':'dimesion5','5':'dimesion6','6':'dimesion7'},"c":1,"m":"50", "sc":1, "f":"nopcs[]"}
};
function adddimensions(what) {
[Code]...
View 1 Replies
View Related
Dec 26, 2011
[URL]..Default.aspx I have both a carousel with images andalso animagemap(notnot published yet)with coords that when clicked i want to write to a cookie file which image or image map coordinate was clicked, so when they are hyperlinked to the next page the correct div opens based on first reading the cookie written to on the previous page. Anybody have a basic script for reading and writing to a cookie using jquery in this fashion?
View 2 Replies
View Related
Jul 23, 2005
I have a frame's onload event calling a function which needs to know
which file was loaded. Is there any java object/method to determine
the file name or any type of file id?
View 1 Replies
View Related
Mar 30, 2006
I know it's possible to retrieve the IP address of a visitor's computer. However, I need to figure out a way to get the IP address of the server where the files are placed. Here's a description of my issue:
My application, along with some HTML Electronic manuals, are loaded onto a server in an electronic classroom. In order to get to any of these items (manuals or app), the students access the server where an index page is located in the D drive and click a link to get to any of them.
The problem is that these manuals are loaded into the D: drive while my application, because it uses ASP, is saved in the C:inetpubwwwroot folder.
The other issue is that this application will not be placed in just one classroom. Each classroom will have its own server with any number of computers accessing it. Since I don't know how each of the servers will be set up, I need to get the IP address so I can access the wwwroot folder.
What I need to do is figure out, using some non-server-side language, what the IP address or computer name of the server is so that I can access the appropriate folder in the wwwroot folder.
View 2 Replies
View Related
Nov 23, 2009
This should be an easy one. I am using a single OnChange event with several <Select> statements, and need to identify the specific <Select> control that fired off the onchange event. I'm certain there must be a way to grab the ID or Name from the specific control in the javascript function, but I haven't been able to find it.
View 2 Replies
View Related
Feb 11, 2006
is there a code for determining the resolution of the computer?
View 3 Replies
View Related
Oct 14, 2011
My spidey senses are telling me this can't be done without making an additional [XMLHttp] request, but ... Any way to read the redirected URL for an image? Suppose I have the following tag:
HTML Code:
<img src='/images/test.jpg' />
And suppose the image request redirects to /images/test.jpg?token=123.
The image src, according to JavaScript is still /images/test.jpg. Any way to determine the new URL? (short of making an AJAX request for the image and reading the response header?)
View 4 Replies
View Related
Jul 23, 2005
onClick="javascript:myFunction()"
or does it HAVE to be
onClick:"myFunction()"
I know 'javascript' is not necessary here, but just want to know whether to include it (which sometimes I do by mistake) is incorrect syntax or not..
View 1 Replies
View Related
Jul 23, 2005
What is the correct construct for accessing "pageYOffset" in another window?
I've tried this, but it doesn't work:
var mainPageYOffset;
//
mainPageYOffset = parent.main.window.pageYOffset;
View 2 Replies
View Related
Dec 23, 2005
I'm facing the bug about the failure of innterHTML while
reading xhtml content inside a DIV, in fact it has passed as html
removing the closing of some nodes. Is there a way to read the content
of the div perfectly how it is in the page, kind of:
var obj = document.getElementById("myDIV");
var realContent = obj.toString();
View 22 Replies
View Related
Jul 9, 2009
I'm working on recreating a paper form as accurately as possible in XHTML. I can't keep my sanity with that man DIVs, so I'm using nested tables.
In most fields (TDs) I have a label and a text box, and I'd like to have the text box fit the width of the TD as accurately as possible, without going on to another line. As far as I've heard, the only way to do this is using JS to get the width of the TD and the label, and then adjust the width of the text box to fit.
I'm using FireFox 3.0.11 for development. For some reason, the width of the TDs is being reported incorrectly. I've tried .width, .style.width, .offsetWidth, .clientWidth and .scrollWidth. They all agree within a few pixels, but are horribly incorrect. My current screen resolution is 1400x1050, and I've taken a screenshot and measured that to confirm - the actual width of the TD is approx. 1130 pixels, but it's being reported by all of those JS functions as +/- 865 px.
None of the tables or TDs have widths defined, it's all just automatic sizing. The only width/size defined at all is an overall div with 2% margins on each side.
View 10 Replies
View Related
Apr 7, 2011
What would the correct syntax be for this:
if('#loaded_max' == 3) {
loading = false;
}
View 3 Replies
View Related
Jul 23, 2005
Is there anyway to determine if a DIV with its overflow style set to
auto has the scrollbars visible? I have a dynamically built table inside
my DIV. If the table is over a certain height and the scrollbars appear,
I want to shrink the width of my table. If the table's height doesn't
exceed the div's height, I want the table to be the same width as the
div. Any ideas?
View 2 Replies
View Related
Jul 23, 2005
I have a script that will set the focus to a particular input box. I want the script to check to see if the input box exist also.
I'm receiving the following error:
'document.ScheduleForm.txtGrossPayroll99' is null or not an object.
The txtGrossPayroll99 is a field that does not exist. I've hard-coded
this name into the script to see if it is working correctly.
I'm using the OnLoad event inside the <Body> tag to execute this
function.
var formInUse = false;
function setFocus()
{
if ((!formInUse) && (typeof(document.ScheduleForm.txtGrossPayroll99) !=
"undefined") && (typeof(document.ScheduleForm.txtGrossPayroll99) !=
null) );{
document.ScheduleForm.txtGrossPayroll99.focus();
}}
View 6 Replies
View Related
Sep 9, 2005
Is there a way to determine the object that a property is in? For
example:
function MyClass() { ... }
MyClass.prototype.myFunc = function() { ... }
var obj = new MyClass();
var sameobj = SOMEFUNCTION(obj.myFunc);
So my goal is to get a reference to the object by just having the
property.
View 3 Replies
View Related
Sep 9, 2005
I have a script that I want to run only when my input box IS NOT
disabled. Can someone tell me if something is wrong with my script? Is
"disabled" the correct property to use?
function TextChanged(i){
if (!document.ScheduleForm["txtGrossPayroll" + i].disabled) {
document.ScheduleForm.txtRecordStatus.value = "Changes Made; Record Not
Saved.";
document.ScheduleForm.txtRecordStatus.style.color = "#FF0000";
}}
View 10 Replies
View Related
Jun 30, 2006
I am writing a greasemonkey script and I can capture the click event.
What I want to know is how do I determine that the click was on a URL
and not just a normal click.
document.addEventListener('click', function(event) {
// event.target is the element that was clicked
alert(event.target.toString());
}, true);
View 3 Replies
View Related
Jul 12, 2007
I am trying to pass the slection made by a user to a javscript
function using the onchange event. The problem is I can get the index
but not the actual value. As my list is variable (dependent on a db)
I cannot hard code to a static index. I either need a way to
determine the number of items in a select control or a way to
determine the actual selection made by the user.
Can anyone enlighten me as to the code to determine what option the
user selects?
View 3 Replies
View Related
Oct 3, 2007
I know how to find a controls' position obviously (i.e.style left,
right, top, offset, etc.), but what I'm a little stumped on is, if
given two controls' positions, how can I tell if one is overlapping/
invading the space of the other?
For example, I have an AJAX dragpanel and am experiencing the common
'bleed through' of dropdown controls when I drag the panel over them.
Naturally the customer doesn't like this. I experimented a little with
the IFrame solution, but did not have much luck. It seems easier now
to just use the 'ondragend' event and show/hide dropdowns accordingly.
Does anyone have a piece of code where, given two control objects as
passing parameters, it returns true or false in regards to them
overlapping or not?
View 4 Replies
View Related