|
Magical? No I don't think I know what you're talking about.
Please explain!
|
|
|
|
|
i mean OO (Object Oriented). but forget it for now.
|
|
|
|
|
|
|
have a jquery on my aspx page which loads a seperate aspx page through iframe inside a jquery modal. I am passing the the value of a textbox to the jquery-modal. Now I have a gridview in modal popup and evrytime i select a row I want to return those values back to base(parent page and populate some textboxes with gridview row in modal.
I am unable pass values back to base page.
my jquery is as below:-
$(function() {
$("#addForm").dialog({
autoOpen: false,
modal: true,
width: 500,
scroll: true,
overlay: {
"background-color": "#000",
"opacity": "0.5",
"-moz-opacity": "0.5"
}
});
$("#btnAddSession").click(function(event) {
var url = "Result.aspx?key=" + encodeURIComponent($("#<%= txtSearch.ClientID %>").val());
alert(url);
$("#popup").attr("src", url);
$("#addForm").dialog("open");
return false;
});
});
my div is as below:-
<div id="addForm" title="Dialog Title" >
<iframe id="popup" width="480"></iframe>
</div>
This opens the new aspx in the jquery modal and passes the value of textbox which i access serverside to perform my search and bing to gridview. But unable to pass values back to base page.
|
|
|
|
|
It is category_parent.xml
<?xml version="1.0" ?>
<list>
<item code="77"><![CDATA[A]]></item>
<item code="10"><![CDATA[B]]></item>
<item code="28"><![CDATA[C]]></item>
<item code="7"><![CDATA[D]]></item>
<item code="1"><![CDATA[E]]></item>
<item code="66"><![CDATA[F]]></item>
<item code="11"><![CDATA[G]]></item>
<item code="29"><![CDATA[H]]></item>
<item code="70"><![CDATA[I]]></item>
<item code="9"><![CDATA[J]]></item>
<item code="63"><![CDATA[K]]></item>
<item code="55"><![CDATA[L]]></item>
<item code="6"><![CDATA[M]]></item>
<item code="8"><![CDATA[N]]></item>
</list>
----------------------------------------------------------
It is category_child.xml
<?xml version="1.0" ?>
<list>
<item parent="1" code="3"><![CDATA[E-1]]></item>
<item parent="1" code="2"><![CDATA[E-2]]></item>
<item parent="6" code="32"><![CDATA[M-1]]></item>
<item parent="6" code="33"><![CDATA[M-2]]></item>
<item parent="6" code="30"><![CDATA[M-3]]></item>
<item parent="7" code="37"><![CDATA[D-1]]></item>
<item parent="7" code="35"><![CDATA[D-2]]></item>
<item parent="8" code="41"><![CDATA[N-1]]></item>
<item parent="8" code="39"><![CDATA[N-2]]></item>
<item parent="9" code="54"><![CDATA[J-1]]></item>
<item parent="9" code="44"><![CDATA[J-2]]></item>
<item parent="10" code="47"><![CDATA[B-1]]></item>
<item parent="10" code="48"><![CDATA[B-2]]></item>
<item parent="11" code="52"><![CDATA[G-1]]></item>
<item parent="11" code="50"><![CDATA[G-2]]></item>
<item parent="29" code="62"><![CDATA[H-1]]></item>
<item parent="29" code="85"><![CDATA[H-2]]></item>
<item parent="55" code="60"><![CDATA[L-1]]></item>
<item parent="63" code="68"><![CDATA[K-1]]></item>
<item parent="63" code="75"><![CDATA[K-2]]></item>
<item parent="66" code="69"><![CDATA[F-1]]></item>
<item parent="66" code="67"><![CDATA[F-2]]></item>
<item parent="70" code="71"><![CDATA[I-1]]></item>
<item parent="77" code="82"><![CDATA[A-1]]></item>
<item parent="77" code="79"><![CDATA[A-2]]></item>
</list>
--------------------------------------------------------
List.html
<table cellpadding="0" cellspacing="0" width="176">
<tr>
<td height="24" align="left">
<select id="l_cat_parent" class="txt1" onChange="setCategory(this.value)" style="width:176px;margin-top:2px">
<option>category_parent</option>
</select>
</td>
</tr>
<tr>
<td height="24" align="left">
<select class="txt1" id="l_cat_child" style="width:176px;margin:4px 0 5px 0">
<option>category_child</option>
</select>
</td>
</tr>
</table>
<script type="text/javascript">
function setCategory(parent){
if(parent=='') parent = null;
if(parent==null){
var select_box = "l_cat_parent";
var select_name = "Product Parent";
var xml_url = "/_data/category_parent.xml"
}else{
var select_box = "l_cat_child";
var select_name = "Product child";
var xml_url = "/_data/category_child.xml"
}
DelOption(select_box);
AddOption(select_box,"","Loading...");
var xmlHttpObj = createHttpRequest();
if(!xmlHttpObj) return "Your browser is not supported";
xmlHttpObj.onreadystatechange = function(){
if(xmlHttpObj.readyState == 4) {
if(xmlHttpObj.status == 200) {
var xmlDom = getXMLDOM(xmlHttpObj);
DelOption(select_box);
AddOption(select_box,"",select_name);
var listings = xmlDom.getElementsByTagName("item");
for (var i = 0; i < listings.length; i++) {
var strCode = listings[i].getAttribute("code");
var strParent = listings[i].getAttribute("parent");
var strName = listings[i].firstChild.nodeValue;
if(strParent==parent)
AddOption(select_box,strCode,strName);
}
if($(select_box).getAttribute('selection')!=''){
SetSelectOption(select_box, $(select_box).getAttribute('selection'));
if($(select_box).onchange) $(select_box).onchange();
}else{
SetSelectOption(select_box, '');
}
}
}
}
xmlHttpObj.open("GET", xml_url); // 비동기모드
xmlHttpObj.send(null);
}
var pcategory = getCookieA("cache","pcategory"); // 기존 선택값
var ccategory = getCookieA("cache","ccategory");
$("l_cat_parent").setAttribute("selection",pcategory);
$("l_cat_child").setAttribute("selection",ccategory);
setCategory('');
var cal = new Calendar('leftCalendar');
cal.className = 'cal';
cal.onCalendarClick = function(clickdate){
var cookieDate = new Date();
cookieDate.setTime(cookieDate.getTime() + (1000 * 60 * 60 * 24 * 365 * 10)); // 10년
if($("l_cat_child").value!=''){
cat_no=$("l_cat_child").value;
setCookieA("cache","pcategory",$("l_cat_parent").value,cookieDate);
setCookieA("cache","ccategory",$("l_cat_child").value,cookieDate);
}else{
cat_no=$("l_cat_parent").value;
setCookieA("cache","pcategory",$("l_cat_parent").value,cookieDate);
setCookieA("cache","ccategory","",cookieDate);
}
location = "/product/list.asp?date="+ clickdate +"&cat_no="+ cat_no;
}
cal.Load('','');
</script>
|
|
|
|
|
Use the Code block to format your code in your question.
Then always give meaningful title in the question title. Ex. Javascript - XML code not working(be specific about that)
what's the error message? which line? check in firefox console....let us know.
|
|
|
|
|
var pcategory = getCookieA("cache","pcategory"); // 88 line
var ccategory = getCookieA("cache","ccategory"); // 89 line
|
|
|
|
|
but what's the error message?
|
|
|
|
|
Hi All,
We built an AJAX timeout feature into our web application that prompts the user just before the session is about to expire if they wish to extend the session. This code works fine in IE8 running Windows Server 2008. However, when we upload this to a Windows Server 2003 server and try to view it in IE7, the timeout notification never shows up, even when the session has timedout and no error is reported.
Is there something that needs installing on the server, or some browser setting that may need changing?
Thank you,
Mel
|
|
|
|
|
i have a search on my aspx page and after entering serch text and on click of search button, i open a jquery modal window whioch loads a seperate aspx page in iframe.
I have been unable to pass the values to by jquery modal and also which is the best way to get the values back from the modal. I am calling an external service in the popup which returns data.
Thanks,
|
|
|
|
|
Do you have to pass value to the Popup and get back to the Main page?
sunaSaRa Imdadhusen
+91 99095 44184
+91 02767 284464
|
|
|
|
|
|
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
|
|
|
|