How To Get The Root Domain And Implement It Into The Script
Oct 5, 2007
I code with javascript in ruby on rails. So I need to switch between localhost and my website. So the domain changes every time. What can I do, so that javascript grabs the root domain, so, lets say: Code:
View 2 Replies
ADVERTISEMENT
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
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
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
Dec 12, 2006
I cannot manage to do a square root operation. I am using the coding:
var a = Math.sqrt(b);
View 3 Replies
View Related
Jul 23, 2005
I have a problem with an application i'm working on (Asp.net using
vb.net for developing). I'm normally used to doing middle tier
development, so my javascript skills are not up to par. Here is my problem:
I have a javascript file called 'PMP/Scripts/Popups.js' (pmp is the root
of the website). In that file is the following function:
function OpenTutorial(sTutID)
{
var sURL = '../support/tutorials.aspx?tutid=' = sTutID;
var sProperties = 'center:yes;etc..'
window.showModalDialog(sURL, self, sProperties);
}
where ../support is acutally pmp/support.
Most of the website pages are located in sub folders from the root of
the website. When editing is to be done on a record, a popup window is
called from the main page. the popup pages are in another sub folder
(i.e. pmp/review would be where review.aspx resides and the edit page
would be located at pmp/review/popups). We give the user a tutorial
icon to click on which calls the OpenTutorial function on a button click
event.
The problem is the tutorial popup page won't load properly when called
from another popup page. I've tried variations of location.href,
location.pathname, location.hostname etc.. but can't seem to get the
pages to open correctly. The most common error i get is that the url is
not correct. here is a sample of the urls being called by the function:
View 1 Replies
View Related
May 21, 2007
I have an html that has a form for example
<form method=post action=blah.html>
<input type=hidde name=myHiddenVar value=''>
blah blah blah
<iframe name=myiFrame frameborder=0 scrolling=no src="anypage.php">currently loading</iframe>
</form>
now in iFrame page (anypage.php) I want a button to control or SET the value of the main FORM (html page) and its variable myHiddenVar, for example here is what I tried and it didnt work...
in anypage.php I hade a button
<input type=button value=change onClick="javascript:parent.myHiddenVar=100">
but the aboue didnt work, is there anything like docuemtroot ?
View 1 Replies
View Related
Jun 16, 2011
I have the following script using the closet method. It works fine for the inner most li tags however the outer li tags don't get seen? So both Root 1 and Root 2 don't get selected but the Sub Cat 1 and Sub Cat 2 get selected fine. I'm sure I'm missing some code to make this work.
[Code]...
View 3 Replies
View Related
Dec 14, 2007
Well, it's been a while since I last visited CF, but I'm finally back and, for the life of me, am drawing a total blank on something that seems like it should be fairly easy to handle.
The Math.sqrt() function works just fine if all a person needs is the Square Root of a number, but what about needing the Cube Root or even a 4th Root of a number?
My first instinct was to use the Math.pow(x,y) function with a negative value for "y." For instance;
var z=Math.pow(27,-3)
This should return a value of 3. Unfortunately, this doesnt seem to work when I tested it through the W3 reference pages, so I am looking for a clue as to how I might go about finding such values, or if it is even possible through Javascript.
View 2 Replies
View Related
Feb 4, 2011
jQuery is ignoring the root element when passed through context. Am not sure if this is intended behavior.[URL]
View 7 Replies
View Related
Mar 3, 2010
I am using a dhtml "Image Slideshow", and I was really happy with I customized its layout to my needs, and it runs perfectly on FF and on IE (wich is very important for me, since in my country most of people still use IE). Check it hereHowever, when I insert the slideshow in my design, it stops working on IE (working in perfection on FF):I am using the original slideshow file in an iframe.(before I tryed to paste the code directly into the page, but it didn't worked, so I thought using an iframe would work, because the code of the original document would be intact)
View 5 Replies
View Related
Jul 12, 2009
i want to make a module to swap ads randomly from folder named �ads� on the root like,, the advertising are either .swf, or .gif all that i need is to play the swf (when one is finished it starts the other one.. till the display of all swf's)..
[URL]
The folder �ads� is supposed to have 5 ads, when it finished number 1... it start randomly until it finish displaying all the advertising swf... i dont want to display only one of the five ... but display all in a random way..may be i have to know the length of the swf (in seconds ) and when it is finished i want to display the second and third .... etc
View 1 Replies
View Related
Sep 2, 2010
I have what some would identify as a Kiosk machine running a browser in full screen(true full screen, no address bar visible). It serves as an internet cafe machine, with unique users and a login system.
What I'm looking to do is when the user leaves the root site (via clicking a button), to embed a frame at the top of the page with an address navigation bar, so I can track the time the user spent browsing. I'm exclusively using firefox, and I'm not concerned with support for such functionality in other browsers.
I assume I can achieve this with javascript, jquery, or ajax, I'm just not sure which to start with and how to begin planning the execution.
View 2 Replies
View Related
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
May 23, 2011
I need to implement more than one gallery on a page, and the current script only allows one gallery. how to change the script to allow more than one gallery on a page?
Here's a copy of the script:
<script type="text/javascript" src="jquery/jquery-1.4.1.js"></script>
<script type="text/javascript">
var currentImage;
[code]....
View 5 Replies
View Related
Jul 25, 2011
I have written a javascript slideshow with pause-play-next-previous buttons, but the images are too many and users have to wait too long especially with slower connections - i wonder if anybody can suggest a way to implement the script with fast preloading of the first few images, increment preloading or a similar trick. I will copy my code below but i also copy first this link:
[URL]
which is an example of increment loading slideshow working fine! javascript and i wouldnt know how to customize it in order to take away the link function, that i dont need, and add captions and buttons etc.
I do know some jquery plugin could do but i am trying to go more into the code, even though i still need a lot of advices and tutorials, the goal is solving this specific problem but also learning! Thx a lot in advance.
Here my code (just 2 images here in the list to make it shorter for you, the complete list is more than 50 pics!):
<script language="JavaScript">
<!--
var interval = 8000;
var random_display = 0;
var imageDir = "portraits/";
[Code].....
View 9 Replies
View Related
Jan 26, 2011
I currently want to implement an overlay and a dialog the same way its used for this sites login .
View 1 Replies
View Related
Sep 29, 2011
I have gone through the basic techniques to implement comet server like streamhub,Maven/Jetty etc. I have following questions for that :
After that I found the issues like in case of Maven/Jetty internet connection is required for downloading certain files from net.So it it possible to implement it if no internet connection is there on machine where the web server is hosted ?
Also I want the open source tools/technologies to achieve the thing mentioned in the above question. and I think stream hub is not a open source free version. which is free/open source to use.
Currently the web application is running on apache web server. so if I use comet server what changes I need to do in that ?
View 2 Replies
View Related
Apr 27, 2010
I want to implement the "Font2Bmp" application on my page. Font2BMP may be driven by the command line. All values must be enclosed in quotes or other matching character. (See /Input) Available options are: ...
My purpose : you give in a text, choose a font and when you hit the "Make" button, the application will be executed. The result has to appears on another page (or the same).
View 4 Replies
View Related
Apr 1, 2010
I am very new to Javascript and am having some difficulties with implementing two forms on the same page. The page in question is [URL]. The form at the top appears on every page and works on all of the other pages except this one. When you try to complete the form it validates the second form on the page. The code for the top form can be found here: [URL] (it is an include file). The two scripts that I am using are as follows:
Top Form: [URL]
Contact Page Form: [URL]
View 2 Replies
View Related
Jul 23, 2005
How to implement mm/dd/yyyy format for textbox?
I have text box with format mm/dd/yyyy. Now I want the cursor i
generated whenever user highlight this textbox and whatever user inpu
replace one of char in "mm/dd/yyyy" one at a time.
View 6 Replies
View Related
Dec 8, 2005
Our project has thousands of web pages.
We have certain default chores we would like to occur as part of the
onload handling for all of these pages.
Rather than modify every page to say
window.attachEvent("onload",defaultChores);
is there some neat way to perhaps tap into the page-loading process so
that the above attachEvent call gets performed implicitly ?
Perhaps this involves some sort of server intervention. That is a
possibility for us, as we have access to the server as well (it's
typically a tomcat server), although admittedly if this is the only way
to do this, then this discussion should quickly migrate out of the
javascript newsgroup and into some sort of web server one.
View 1 Replies
View Related
Mar 18, 2010
I want to implement the jQuery GUID Helper plugin into my web app but I don't know what's the "best practice" method of incorporating it into my code.I'm basically creating a cart system from scratch (figured it was asufficientlycomplicated system to use when learning jQuery). When the visitor first adds an item to their cart is when I wanted to create the GUID for the visitor. I have a cart-handler.js script that I link to from the item view page:
<script type="text/javascript" src="/js/cart-handler.js"></script>
That script's first line is my$(document).ready(function(){ and the script handles AJAX calls to loading the data into cart record in my MySQL database, updates the cart total on the items page, and changes the button from "Add Item" to "Update Quantity".So would I need to link to the jquery.Guid.js script right from the view items file for my item view page? Or can I reference the plugin from the cart-handler.js file?
View 1 Replies
View Related
Jun 11, 2010
I am replacing a simple click function with the mousehold function using the mousehold plugin. For some reason it is not working.
$(
window
).load(
function(){
$(
document
).click(
function(){
$(
document
).mousehold(
200,
function(){
//Do somethoing here each time the Timeout Occurs
}});});
//End Window Load Function
[URL]
View 2 Replies
View Related
Jul 15, 2009
I am trying to do something like this.if a button is clicked call one function
$('.saveButton').click(function(){
////call one function
});
else call another function. how to implement if else in a clicked event.
View 2 Replies
View Related
May 21, 2010
I am trying to implement a version of the datepicker. However, I would like the calendar to open in a modal dialog box rather than sliding open next to the text box.This is the closest example I've been able to find, but there are a few issues - I would like the user to click on the text box to change the input, and obviously the small input box in the corner of the calendar is a problem...
[URL]
View 1 Replies
View Related