Jump to content

dawg1

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

About dawg1

  • Birthday 12/07/1985

Profile Information

  • Gender
    Female
  • Location
    Athens, GA

dawg1's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. So I figured out my problem with IE. Caching. To resolve the issue I added + escape(new Date()); to my var strURL. As for the minibasket replacing the parent div, it still does it. I think the issue is because the mini .hidden div is stacked inside the mini div... <div id="mini"> <div class="hidden"></div> </div>
  2. Ok, I believe I have resolved the JS errors. Now in IE the only mini div that loads says the cart is empty, but, again, works great in firefox, chrome, safari.
  3. Thanks for the advice. I put in the code and I am getting alerts, I'm not exactly sure where or what I need to fix.... function callback_fn () { var strURL="/TKMINI.html"; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { if (req.status == 200) { alert($('#mini').html()); document.getElementById('mini').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } } req.open("GET", strURL, true); req.send(null); } } I get the first alert (screenshot_1.png) after I add my first product. I get the second alert (screenshot_2.png) thereafter (for each product I add after the first, I get this same alert). So it appears that the div is not refreshing, or loading in the new products, after the first product is added. I can even go to my shopping cart (a different page on the website) clear the entire cart, go back to the product page, add a new (different) product, and the minibasket loads with the information of the very first product -which is no longer even in the basket. Any ideas??? [attachment deleted by admin]
  4. This works great in firefox, but in IE the div with refresh only 1 time. Any suggestions how to fix it so that continues to refresh?
  5. So far I've gotten this to work.. findCOURSE.php <select name="COURSE" onChange="get_Results(this.value)"> <option>Select Course</option> <?php require "config.php"; $CURR=$_GET['CURR']; $COURSE=$_GET['COURSE']; $query = "SELECT DISTINCT CURR, COURSE FROM UGASU11 WHERE CURR = '$CURR' order by COURSE"; $result=mysql_query($query); while($row=mysql_fetch_array($result)) { ?> <option value=<?php echo $row['CURR'],$row['COURSE']?>><?php echo $row['COURSE']?></option> <? } ?> </select> outputs... <select name="COURSE" onChange="get_Results(this.value)"> <option>Select Course</option> <option value=ADPR3110>3110</option> <option value=ADPR3520>3520</option> <option value=ADPR5910>5910</option> <option value=ADPR5990 H>5990 H</option> </select> which is what I need. But, I can't figure out the next step. This is the function that should submit to textbooks.php for the results (doesn't work) function get_Results(CURR,COURSE) { var strURL="/textbookresults.php?CURR="+CURR+"&COURSE="+COURSE; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { if (req.status == 200) { document.getElementById('RESULTS_div').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } } req.open("GET", strURL, true); req.send(null); } } and this is the last query used to display the results... $query = "SELECT * FROM UGASU11 WHERE CURR = '$CURR' AND COURSE = '$COURSE' order by INSTRUCTOR";
  6. so... it isn't working as I need it to. The last function get_Results is only calling the COURSE variable. I need it to call TERM, CURR, and COURSE in order to find the correct results.
  7. Ok, got it to update my <div id="mini"> with function callback_fn () { var strURL="/TKMINI.html"; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { if (req.status == 200) { document.getElementById('mini').innerHTML=req.responseText; } } } req.open("GET", strURL, true); req.send(null); } } </script> Next step, hide <div id="bookcart"> function callback_fn () { var strURL="/TKMINI.html"; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { if (req.status == 200) { document.getElementById('mini').innerHTML=req.responseText; } } } req.open("GET", strURL, true); req.send(null); } setTimeout( "jQuery('#bookcart').fadeOut();",1000 ); } Problem is that it hides the 'mini' div, not just bookcart, and I can't figure out why. html <div id="mini"> ---CONTENT--- <div class="hidden"> <div id="bookcart"> <div id="minibask">---CONTENT---</div> <div id="minibask_total">---MORE CONTENT---</div> </div> </div> </div> - OR - html/Miva script (if you're familiar with Miva Merchant) <div id="mini"> <mvt:item name="toolkit" param="basket|itemcount" /> <mvt:if expr="g.itemcount GT 0"> <a href="&mvt:global:secure_sessionurl;Screen=BASK" title="checkout" border="0"><img src="graphics/00000001/images/ShoppingCart.png" class="textmiddle" alt="Shopping Cart" /></a> <h8><strong>(&mvte:toolkit:basketcount;)</h8></strong> <div class="hidden"><mvt:item name="toolkit" param="render|TKMINI" /></div> <mvt:else> <a href="&mvt:global:secure_sessionurl;Screen=BASK" title="checkout" border="0"><img src="graphics/00000001/images/ShoppingCart.png" class="textmiddle" alt="Shopping Cart" /></a> (0) </mvt:if> </div> css #mini { padding: 2px; width:150px; float:right; } #mini .hidden { display:none; } #mini:hover .hidden { display:inline; } #minibask { background-color: #eeeeee; border:#cccccc 2px solid; position:relative; width:350px; line-height:1.1em; z-index:100; } #minibask_total { background-color: #cccccc; border:#cccccc 2px solid; width:350px; text-align:right; position:relative; z-index:100; line-height:1.1em; } Any Ideas?
  8. Thanks for responding! I should mention that I am quite a newbie to .js I have been searching the web for callback functions but I don't know that I am moving in the right direction. Could you share some sites that could help me out? I take that I need to edit the .js file and put a script in my html?
  9. Hi All! I am using a Greybox (found at: orangoo.com/labs/GreyBox/) to display my product pages, like the quick product display on Target.com. I have a minibasket in a div on the parent page where after a product is added to the cart the div updates and displays the cart info onhover. Problem is that the only way I know of to update the parent page is modifying the gb_scripts.js with 'this.reload_on_close=true' 'window.location.reload(true);' I want to avoid reloading the entire parent page so that the customer doesn't have to restart their product search - as it gets reset when the page reloads. Is there a way to only refresh the minibasket div?
  10. It is. Thank You SO MUCH for all of your help! I really can't give you even praise and thanks!
  11. RESOLVED! I don't know why I didn't think of this earlier, but I didn't need to string my variables together (TERM,CURR,COURSE) as the function somehow already stored the first two variables.
  12. the alert box is telling me that my variables (TERM,CURR,COURSE) are undefined...
  13. main.php <!doctype html public "-//w3c//dtd html 3.2//en"> <html> <head> <title>OCBS Textbooks</title> <meta name="GENERATOR" content="Arachnophilia 4.0"> <meta name="FORMATTER" content="Arachnophilia 4.0"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Style-Type" content="text/css"> <link href="css/00000001/style.css" rel="stylesheet" type="text/css"> <link href="css/00000001/layout.css" rel="stylesheet" type="text/css"> <script language="javascript" type="text/javascript"> // Roshan's Ajax dropdown code with php // This notice must stay intact for legal use // Copyright reserved to Roshan Bhattarai - nepaliboy007@yahoo.com // If you have any problem contact me at http://roshanbh.com.np function getXMLHTTP() { //fuction to return the xml http object var xmlhttp=false; try{ xmlhttp=new XMLHttpRequest(); } catch(e) { try{ xmlhttp= new ActiveXObject("Microsoft.XMLHTTP"); } catch(e){ try{ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e1){ xmlhttp=false; } } } return xmlhttp; } function get_CURR(TERM) { var strURL="findCURR.php?TERM="+TERM; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { document.getElementById('CURR_div').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } } req.open("GET", strURL, true); req.send(null); } } function get_COURSE(CURR) { var strURL="findCOURSE.php?CURR="+CURR; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { document.getElementById('COURSE_div').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } } req.open("GET", strURL, true); req.send(null); } } function get_Results(TERM,CURR,COURSE) { var strURL="textbookresults.php?TERM="+TERM+"&CURR="+CURR+"&COURSE="+COURSE; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { alert("Response "+req.responseText); document.getElementById('RESULTS_div').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } } req.open("GET", strURL, true); req.send(null); } } </script> <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="js/cufon-yui.js"></script> <script type="text/javascript" src="js/Futura_MdCn_BT_400.font.js"></script> <script type="text/javascript" src="js/cufon-replace.js"></script> <script type="text/javascript" src="js/maxheight.js"></script> <script type="text/javascript">var GB_ROOT_DIR = "http://shopocbs.com/greybox/";</script> <script type="text/javascript" src="greybox/AJS.js"></script> <script type="text/javascript" src="greybox/AJS_fx.js"></script> <script type="text/javascript" src="greybox/gb_scripts.js"></script> <link href="greybox/gb_styles.css" rel="stylesheet" type="text/css"> <!--[if lt IE 7]> <link href="ie.css" rel="stylesheet" type="text/css" /> <![endif]--> </head> <body id="page2" onload="new ElementMaxHeight();"> <div id="main-tail-hor"> <div id="main-bg"> <div id="main-tail-ver"> <div id="main-bg-top"> <div id="main-bg-bot"> <div id="main"> <!-- header --> <div id="textbookheader"> <a href="shopocbs.com"><img src="graphics/00000001/images/logo.gif" id="logo" alt=""></a> <a href="#" id="rss">RSS Submit</a> <div id="menu"> <ul> <li><a href="http://www.shopocbs.com/ABUS.html"><span><span>Store Info</span></span></a></li> <li><a href="http://www.shopocbs.com/Apply.html"><span><span>Apply</span></span></a></li> <li><a href="http://www.shopocbs.com/TSRV.html"><span><span>Tech Services</span></span></a></li> <li><a href="http://www.shopocbs.com/GEAR.html"><span><span>UGA Gear</span></span></a></li> <li class="act"><a href="#"><span><span>TEXTBOOKS</span></span></a></li> </ul> </div> <div id="HOME" onclick="location.href='http://www.shopocbs.com';" style="cursor:pointer;"></div> <img src="graphics/00000001/images/textbookslogan.gif" id="slogan" alt=""> </div> <!-- content --> <div id="content"> <div class="row-1"> <div class="wrapper"> <div class="col-1 maxheight"> <h2><b><b>Select Your Books</b></b></h2> <div class="indent-1"> <form method=post name=textbookform action='textbookresults.php' target='iframe'> <div id="first_drop_down"> <select name="TERM" onChange="get_CURR(this.value)"> <option>Select Term</option> <option value=SU11>SU11</option> </select> </div> <div id="CURR_div"><select><option>Select Term First</option></select></div> <div id="COURSE_div"><select><option>Select Curriculum First</option></select></div><br /> <input type="button" value="Get My Books" onClick="get_Results();"> </form></div> <div class="indent-1"> <h4>Textbook Rental Program</h4> <a href="http://www.shopocbs.com/rentals.html" onclick="return GB_showCenter('Rental Agreement', this.href)" class="link">Rental Agreement</a> <div class="clear"></div> <a href="#" class="link">Registration Form</a> </div> <div class="indent-1"> <h4>Baxter Street Bookstore</h4> <a href="#" class="link">UGA Law School Books</a> </div> <div class="indent-1"> <h4>East Campus Bookstore</h4> <a href="http://www.ecbsonline.com" class="link">UGA IDL Books</a> <div class="clear"></div> <a href="http://wwww.ecbsonline.com" class="link">Athens Tech Books</a> <div class="clear"></div> <a href="http://ecbsonline.com" class="link">GSC Books</a> <div class="clear"></div> </div> </div> <div class="col-2 maxheight"> <h2><b><b>Your Textbook Information</b></b></h2> <div class="indent-1"> <iframe id="iframe" name="iframe" width="100%" height="35%"> <p>Your browser does not support iframes.</p> </iframe></div> </div> </div> </div> </div> <div class="row-2"> <h3><span><span><strong>Interesting Links</strong></span></span></h3> <div class="box"> <div class="inner-1"> <div class="wrapper"> <ul class="list-2"> <li> <a href="http://oasisweb.uga.edu"><img src="graphics/00000001/images/oasis.jpg" alt="Oasis Web" /></a> <strong><a href="http://oasisweb.uga.edu">Oasisweb.uga.edu</a></strong> Online Access to UGA Student Information Systems </li> <li> <a href="http://www.studentnotes.com/UGAstudent_notes.html"><img src="graphics/00000001/images/student_notes.jpg" alt="Student Notes" /></a> <strong><a href="http://www.studentnotes.com/UGAstudent_notes.html">Student Notes</a></strong>Study Guides complied by students with a 3.4+ G.P.A.</li> <li><a href="http://www.secsports.com"><img src="graphics/00000001/images/sec.jpg" alt="SEC Sports" /></a> <strong><a href="http://www.secsports.com">SECsports.com</a></strong> The official site of the Southeastern Conference </li> <li class="extra"> <a href="http://www.dawgwear.net"><img src="graphics/00000001/images/dawgwear.jpg" alt="Dawgwear.net" /></a> <strong><a href="http://www.dawgwear.net">Dawgwear.net</a></strong> UGA Merchandise, apparel, gifts, Diploma Frames, and more!</li> </ul> </div> </div> </div> </div> </div> <!-- footer --> <div id="footer"> <p>OCBS, Inc.<span> © 2009</span> | <a href="http://www.facebook.com/pages/Off-Campus-Bookstore/51670009168" target="blank"> <img src="facebook_footer.png" alt="Find us on Facebook" /></a></p> </div> </div> </div> </div> </div> </div> </div> <script type="text/javascript"> Cufon.now(); </script> </body> </html> I think these are the same but I will report them just to make sure... findCURR <!--//---------------------------------+ // Developed by Roshan Bhattarai | // http://roshanbh.com.np | // Contact for custom scripts | // or implementation help. | // email-nepaliboy007@yahoo.com | //---------------------------------+--> <? #### Roshan's Ajax dropdown code with php #### Copyright reserved to Roshan Bhattarai - nepaliboy007@yahoo.com #### if you have any problem contact me at http://roshanbh.com.np #### fell free to visit my blog http://roshanbh.com.np ?> <select name="CURR" onchange="get_COURSE(this.value)"> <option>Select Curriculum</option> <?php require "config.php"; $TERM=$_GET['TERM']; $query = "SELECT DISTINCT CURR FROM UGASU11 WHERE TERM = '$TERM' order by CURR"; $result=mysql_query($query); while($row=mysql_fetch_array($result)) { ?> <option value=<?php echo $row['CURR']?>><?php echo $row['CURR']?></option> <? } ?> </select> findCOURSE <!--//---------------------------------+ // Developed by Roshan Bhattarai | // http://roshanbh.com.np | // Contact for custom scripts | // or implementation help. | // email-nepaliboy007@yahoo.com | //---------------------------------+--> <? #### Roshan's Ajax dropdown code with php #### Copyright reserved to Roshan Bhattarai - nepaliboy007@yahoo.com #### if you have any problem contact me at http://roshanbh.com.np #### fell free to visit my blog http://roshanbh.com.np ?> <select name="COURSE"> <option>Select Course</option> <?php require "config.php"; $CURR=$_GET['CURR']; $query = "SELECT DISTINCT COURSE FROM UGASU11 WHERE CURR = '$CURR' order by COURSE"; $result=mysql_query($query); while($row=mysql_fetch_array($result)) { ?> <option value=<?php echo $row['COURSE']?>><?php echo $row['COURSE']?></option> <? } ?> </select>
  14. dd3ck.php works and give me the results I want and need when not trying to post them to a div so I don't think the syntax is wrong there (but what do I rally know?). Could it be I am not calling the right variables in the function? I tried what you gave me and got the alert There was a problem while using XMLHTTP Internal Server Error
  15. Oh, wow, sorry! This is the alert Response <style type="text/css"> A:link {color: white;} A:hover {color: red;} </style> <!doctype html public "-//w3c//dtd html 3.2//en"> <html> <head> <title>Textbooks</title> <script type="text/javascript"> var GB_ROOT_DIR = "greybox/"; </script> <script type="text/javascript" src="greybox/AJS.js"></script> <script type="text/javascript" src="greybox/AJS_fx.js"></script> <script type="text/javascript" src="greybox/gb_scripts.js"></script> <link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="js/jquery-1.6.1.min.js"></script> </head> <body> <table style='color:#fff;'></table></body></html> It's not generating the php...?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.