|
|
You can get Value of Parent page from child like
var parentTextValue = window.parent.document.forms[0].txtBox.value;
Now you can send value to the Parent like
window.parent.document.forms[0].txtBox.value = "Set from child"
Thanks,
Imdadhusen
sunaSaRa Imdadhusen
+91 99095 44184
+91 02767 284464
|
|
|
|
|
window.parent gives an error of null object
|
|
|
|
|
Heya,
I'm trying to combine google streetview with input I get from other scripts.
For example, I get a street name from a other script, but want an streetview window to automaticly load that street.
I've been reading through the google documentation, and tried some examples found on the internet, but my decent lack of js skills are lacking me from getting much further.
Google Maps StreetView[^] is an example, but this one works with an dragger, while I try to make it load automaticly on other input.
Any one who can sling me into the right direction?
|
|
|
|
|
These are the jscript functions you need ...
This function takes an address as a string
function showAddress(thisaddress)
{
var geocoder = new GClientGeocoder();
geocoder.setBaseCountryCode("uk");
geocoder.getLatLng(thisaddress, gotPoint);
searchaddress=thisaddress
}
The next function is called by the one above in order to show the address or marker on a map
Note that I've commented out the code that places a marker at the point
function gotPoint(pt)
{
if (!pt)
{alert(searchaddress + " not found");}
else
{
document.formInput.txtPoint.value = pt;
panoClient.getNearestPanoramaLatLng(pt, fnearestpano);
}
}
Finally, the function finds the nearest StreetView image to the address
function fnearestpano(latlng)
{
if (!latlng)
{ alert("nearest view not found"); }
else
{
myPano = new GStreetviewPanorama(document.getElementById("pano"));
myPano.setLocationAndPOV(latlng, myPOV);
}
}
Hope that helps?
Richard
|
|
|
|
|
Hi,
I am using confirm('Do you want to proceed?'). But here am getting Ok/Cancel alert.
But i need Yes/No option.
How to do that?
|
|
|
|
|
|
|
Sir, your solution is just great..!!
100 , man;
Help people,so poeple can help you.
|
|
|
|
|
Sir, this is the first question i asked my tainners when i move to the web, but i found no answer. so i used a <&div> with style="display:none;position:absolute" as a modal dialog witch i can design freelly.
100
Help people,so poeple can help you.
|
|
|
|
|
For true Javascript standard it is not possible. This will only work on 32 bit Windows and only on IE. On Firefox it will not show Yes/No prompt.
<script language="javascript">
function window.confirm(str)
{
execScript('n = msgbox("'+str+'","4132")', "vbscript");
return(n == 6);
}
var r = confirm("Can you do it?");
alert(r);
</script>
|
|
|
|
|
Hello all,
I am using the Chrome browser to run a simple html test page containing jQuery code.
If I load it from the disk path, it works as expected.
If, instead, I use the IIS, then it gives the $ is not defined error. Funny enough, using the incognito mode makes it work
Any idea about what could be wrong here?
Bogdan Rechi.
|
|
|
|
|
A code sample may help.
Chris J
www.redash.org
|
|
|
|
|
Thank you and Shahriar for the answers. There is nothing special with the source code and it is even located in the same directory as the jQuery. I think it is just related to the way Chrome functions, since it works as expected in the incognito mode.
Here it is a fragment (relevant, I hope):
//...
</style>
<script type="text/javascript" src="jquery-1.5.min.js"></script>
<script type="text/javascript">
var x = 10;
$(window).load( // error here, $ unknown
function()
{
console.info("jquery loaded");
testLoad();
});
//...
Bogdan Rechi.
|
|
|
|
|
I ran this code without error in Chrome v9.0.597.98 beta without issue under the normal mode. Under firefox and IE it complained about console not not being defined.
<html>
<head>
<script type="text/javascript" src="jquery-1.5.min.js"></script>
<script type="text/javascript">
var x = 10;
function testLoad()
{
alert("hi");
}
$(window).load(
function()
{
console.info("jquery loaded");
testLoad();
});
</script>
</head>
<body>
<p>Testing jQuery</p>
</body>
</html>
Chris J
www.redash.org
|
|
|
|
|
Hi,
you need to provide your HTML code where you referenced the jQuery in order to investigate the issue. As of now it seems you are missing relative path respect to your application.
|
|
|
|
|
You should provide HTML code and also mention Directory structure where are you store .js file, this may helpful to diagnose the problem.
sunaSaRa Imdadhusen
+91 99095 44184
+91 02767 284464
|
|
|
|
|
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
I hope the above information will be helpful. If you have more concerns, please let me know.
|
|
|
|
|
Hello all,
I have a simple web form that use an email address to send information once it's submitted. I need to modify it to where it sends the info to an access database. How can I make that happen?
javascript file:
function submitForm() {
document.getElementById('apply').submit();
clearForm();
}
function clearForm(){
var i;
for (i = 0; (i < document.forms.length); i++) {
document.forms[i].reset();
}
}
function addOption(selectbox,text,value ){
var optn = document.createElement("option");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}
function addOption_list(){
var quan = new Array("1","2","3","4","5+");
for (var i=0; i < quan .length;++i){
addOption(document.apply.quantity, quan[i], quan[i]);
}
}
function addOption_list2(){
var quan = new Array("1","2","3","4","5","6","7","8","9","10+" );
for (var i=0; i < quan.length;++i){
addOption(document.apply.quantitys, quan[i], quan[i]);
}
}
function toggle(obj) {
var busDiv = document.getElementById('busi');
var indDiv = document.getElementById('ind');
if (obj.value == 'business'){
busDiv.style.display = '';
indDiv.style.display = 'none';
}
else{
busDiv.style.display = 'none';
indDiv.style.display = '';
}
}
web form:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Untitled</title>
<link href="wireless.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="form.js"></script>
</head>
<body onload="addOption_list(); addOption_list2(); divSelection()" >
<div id="outer">
<img src="" alt="logo" usemap="#logomap" class="carrierLogo" />
<map id="logomap" name="logomap">
<area shape="rect" coords="0,0,399,120" href="#" alt="home"/>
</map>
<div id="inner">
<form id="apply" name="apply" action="mailto:info@donate.com" method="post" enctype="text/plain">
<fieldset>
<legend>Donor Type</legend>
<label for="donerType">
<input type="radio" id="businessDoner" name="donerType" value="business" checked="checked" onclick="toggle(this); " />
Business
</label>
<label for="donerType">
<input type="radio" id="individualDoner" name="donerType" value="individual" onclick="toggle(this)" />
Individual
</label>
</fieldset>
<fieldset id="contact" >
<legend>Donor Information</legend>
<div id="busi" >
fields..
..
more fields..
</div>
<div id="ind" style="display: none" >
fields..
..
more fields..
</div>
</fieldset>
<div>
<label for="submitBtn">Submit <input type="button" value="Submit" onclick="submitForm();" id="submitBtn"/></label>
<label for="cancelBtn">Cancel <input type="reset" value="Cancel" id="cancelBtn"/></label>
</div>
</form>
</div>
</div>
</body>
</html>
|
|
|
|
|
|
Yeah that's what I ended up doing
Thanx for the reply though!
|
|
|
|
|
Can anyone help me out I'm a bit stuck on how to create a javascript array from some XML.
I've been trying to debug javascript code(not java) for Google (Spreadsheet) documents and there are no useful debugging facilities.
As their spreadsheet contents are manipulated through a javascript array, I downloaded the spreadsheet as an *xls file imorted it into MSAccess then exported the table to XML. This not only gives me the XML file but also the schema if I need it. By using a HTML wrapper I can now import the replica XML data and external javascript files into an environment which CAN be debugged properly. e.g. Firefox with Firebug, or similar
Ignoring schemas if possible, How do I best convert XML back into a javascript array? Once i have solved this, I think it my home-made IDE will be of use to others experiencing the same debugging problems.
|
|
|
|
|
JSON Tutor[^]
Please just go through JSON. I think that may be of some help
|
|
|
|
|
Hi,
I would like to check if a session has expired using Javascript without renewing the session.
Does anyone have any ideas?
Thank you
|
|
|
|
|
At the moment I have code that just before the session expires displays a message to the user asking them to confirm they are still there. This message is triggered using setTimeout() in JavaScript. From this point onwards I would like to call a server-side (c#) function to periodically check if the session has expired, until the session has expired. Is there a way I can call a server-side function from JavaScript without renewing the session?
I tried calling a [WebMethod] c# function but it seems these calls renew the session as it never replies that the session has expired.
Any help would be really appreciated.
Thank you,
Mel
|
|
|
|