JavaScript - Not Really Sure, Please Help! Internetsecure Advanced Product String
//*Below is the code that i can't get to work. It's suppose to post a product string to internetsecure's gateway. I was successful in building one version of this here is the link below. if you want to take a look at one that works you can view the source from the link below. I'm extremely new with JavaScripting.
https://testwww.internetsecure.com/m....asp?page=SAM5 If you want to try it out copy the code into a file and save it as ticket.html*// <script type="text/javascript"> function ChangeProducts(amountIn) { var quantity = parseInt(document.gotoIS.txtQuantity.value); var unitPrice, totalPrice if(description = "General Tickets") unitPrice = 60.32; else if(description = "Senior Tickets") unitPrice = 54.82; else if(description = "Groups 8 General Tickets") unitPrice = 54.82; else if(description = "VIP Tickets") unitPrice = 93.22; else if(description = "Group 8 VIP Tickets") unitPrice = 87.74; else unitPrice = 60.32; document.gotoIS.txtUnitPrice.value = unitPrice.toFixed(2); document.gotoIS.txtTotalPrice.value = totalPrice.toFixed(2); document.gotoIS.txtDescription.value = description; // Create Advanced Product string for InternetSecure Processor// document.gotoIS.Products.value = ""+ unitPrice +"::"+ quantity +"::SHOW1::"+ description +"::{TEST}"; } </script> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <FORM NAME="gotoIS" METHOD="POST" action ="https://test.internetsecure.com/process.cgi" onSubmit="ChangeProducts()"> <FONT COLOR="00007f">Select ticket type</FONT><br> <input type="hidden" name="GatewayID" VALUE="106" /> <input type="hidden" value="English" name="language" /> <input type="hidden" value="https://testwww.internetsecure.com/merchants/Demopage.asp?page=THNK" name="ReturnURL"> <input type="hidden" value="https://testwww.internetsecure.com/merchants/Demopage.asp?page=SAM1" name="xxxCancelURL"> <font color="red">*</font>Select Ticket to Order: <select name="txtDescription"> <option value="General Tickets">$60.32 USD - General Tickets $55.00 each plus tax.</option> <option value="Senior Tickets">$54.82 USD - Senior Citizen Discount over 55 $50.00 each plus tax.</option> <option value="Groups 8 General Tickets">$54.82 USD - Groups of 8 or more $50.00 each plus tax.</option> <option value="VIP Tickets">$93.22 USD - VIP Tickets $85.00 each plus tax.</option> <option value="Group 8 VIP Tickets">$87.74 USD - VIP Tickets with groups of 8 or more $80.00 each plus tax.</option> </select> Quantity of tickets: <input type="text" name="txtQuantity" maxlength="2" sixe="2" value=""><br> <br> <input type="hidden" name="txtUnitPrice" value=""> <input type="hidden" name="Products" value=""> <input type="Submit" Value="Submit Donation"> </FORM> Similar TutorialsSo, I don't know if javascript is not able to calculate this but I would like to know if it's possible here is the formula: Monthly Payment = premium x [(0.006(1.006)^term)/((1.006)^term-1)]; Here is the same function with values. 2131.33 = 6383.40 x [(0.006(1.006)^3)/((1.006)^3-1)]; I haven't been able to make it come out correctly yet. Is it even possible? Hi there, Hopefully someone will be able to help me here. I found the below script that works fine for the actual countdown, but when the user refreshes the page, the countdown starts from 5 minutes again. What I am trying to do, is handle users that put something in their shopping cart and then get side tracked or what ever reason and that same product then being purchased by another person when I only have 1 left. So using PHP I am going to subtract the qty of that product by 1 and then I want the website to either put it back, if the users checkout times out, or if a normal process it is taken out permanently. So long story short I think I need some sort of 'memory' for the javascript, so the user can't just keep refreshing and it starting from 5 minutes each time. Also it needs to be carried through to other pages. Your help is greatly appreciated. Thanks, Simon. Code: <script type="text/javascript"> /* This script and many more are available free online at The JavaScript Source :: http://javascript.internet.com Created by: Neill Broderick :: http://www.bespoke-software-solutions.co.uk/downloads/downjs.php */ var mins var secs; function countdown() { mins = 1 * CDm("5"); // change minutes here secs = 0 + CDs(":01"); // change seconds here (always add an additional second to your total) CDredo(); } function CDm(obj) { for(var i = 0; i < obj.length; i++) { if(obj.substring(i, i + 1) == ":") break; } return(obj.substring(0, i)); } function CDs(obj) { for(var i = 0; i < obj.length; i++) { if(obj.substring(i, i + 1) == ":") break; } return(obj.substring(i + 1, obj.length)); } function CDdis(mins,secs) { var disp; if(mins <= 9) { disp = " 0"; } else { disp = " "; } disp += mins + ":"; if(secs <= 9) { disp += "0" + secs; } else { disp += secs; } return(disp); } function CDredo() { secs--; if(secs == -1) { secs = 59; mins--; } document.getElementById("countdown").firstChild.nodeValue = CDdis(mins,secs); //document.cd.disp.value = dis(mins,secs); // setup additional displays here. if((mins == 0) && (secs == 0)) { window.alert("Time is up. Press OK to continue."); // change timeout message as required // window.location = "yourpage.htm" // redirects to specified page once timer ends and ok button is pressed } else { countdown = setTimeout("CDredo()",1000); } } function coundowninit() { countdown(); } </script> Code: <span id="countdown"> </span> Ok, for starters I'm not a beginner and my website is running under standards mode (not quirks). When my site loads I perform: Code: window.location.replace(window.location.href + "#encodedstuff"); The effect being that no new history points are created and the very first history point now includes some encoded info in the hash. When the user closes and relaunches IE8 and then chooses "reopen last browsing session" I expect IE to make the request for the page including the hash value. It does NOT! It simply makes the request for the URL without the hash (and then adds the hash as the next history point). I need help figuring out why and if there is a way to accomplish this without needing to add a parameter to the location get request (which will cause my site to reload upon launch if this parameter is not already set... I don't want it doing that). Please note that the browser DOES behave if I copy the new URL, including the hash value and paste it into a new tab (closing the old tab). When I relaunch IE8 and reopen the previous session it does make the request with hash value and my site is able to get the required info out of the hash. It only fails for a tab that initially did not have a hash and my script performs the above location.replace. Solving this is critical for my application, so I seriously appreciate any help! I have used a Javascript to prepopulate text fields and checkbox's etc. However I can't make it populate a text area. Would anyone be kind enough to help me with the code for it? Any help would really be appreciated: (source code below) Code: // preset.js Copyright 2009 by Richard L. Trethewey - All Rights Reserved // Permission is granted to use this code as long as this copyright notice // is left intact. For more information, see http://www.rainbodesign.com/pub/ // First, get the query string contents from the URL used by lopping off the "?" var query = location.search.substr(1, location.search.length-1); function findForm(theForm) { var formCount = document.forms.length; if (document.getElementById) { formElement = document.getElementById(theForm); } else { for (i=0; i<formCount; i++) { if (document.forms[i].name == theForm) { formElement = document.forms[i]; } } // endFor } // endif document.getElementById return formElement; } // end findForm function setOption(theOption,choice) { max = theOption.length; for (i = 0; i < max; i++) { if (theOption.options[i].value == choice) { theOption.options.selectedIndex = i; } } // end for i } // end setOption function setRadio(theOption,optionName) { max = theOption.length; for (i = 0; i < max; i++) { // alert(theOption[i].name + ' ' + theOption[i].checked); if (theOption[i].value == optionName) { theOption[i].checked = true; } } // end for i } // end setRadio function fixQString(theStr) { pattern = '\\+'; flags = 'g'; reg_exp = new RegExp(pattern, flags); theStr = theStr.replace(reg_exp, ' '); theStr = unescape(theStr); return theStr } // end fixQStr function populate(formName) { if (query) { // Was there a query string? var params = query.split("&"); // Yes! Split them up var theForm = findForm(formName); // Locate the form with the correct name/ID if (theForm != null) { // Did we find the form? for (q=0; q<params.length; q++) { xy = params[q].split("="); // Split the command into name/value pair paramName = xy[0]; newValue = fixQString(xy[1]); if (theForm.elements[paramName]) { // does named element exist? // alert(theForm.elements[paramName].type + ' ' + paramName); switch(theForm.elements[paramName].type) { case 'text': theForm.elements[paramName].value = newValue; break; case 'hidden': theForm.elements[paramName].value = newValue; break; case 'select-one': setOption(theForm.elements[paramName], newValue); break; case undefined: // a kludge to handle radio buttons setRadio(theForm.elements[paramName], newValue); break; case 'checkbox': theForm.elements[paramName].checked = true; break; } // end switch } // endif theForm.elements[paramName] } // end for q } // endif {theForm) } // endif (query) } // end populate() Hello, I am trying to create multiple google maps with multiple directions that load on one page. I have tried duplicating the var and function names but I haven't been able to get it to work. Does anyone have any ideas? Any help or suggestions would be greatly appreciated! -Topianno Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Google Maps JavaScript API Example: Advanced Directions</title> <script src=" http://maps.google.com/?file=api&v=2.x&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type="text/javascript"></script> <style type="text/css"> body { font-family: Verdana, Arial, sans serif; font-size: 11px; margin: 2px; } table.directions th { background-color:#EEEEEE; } img { color: #000000; } </style> <script type="text/javascript"> var map; var map2; var gdir; var gdir2; var geocoder = null; var geocoder2 = null; var addressMarker; var addressMarker2; function initialize() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map_canvas")); gdir = new GDirections(map, document.getElementById("directions")); GEvent.addListener(gdir, "load", onGDirectionsLoad); GEvent.addListener(gdir, "error", handleErrors); setDirections("San Francisco", "Mountain View", "en_US"); setDirections2("San Francisco", "Mountain View", "en_US"); } } function setDirections(fromAddress, toAddress, locale) { gdir.load("from: " + fromAddress + " to: " + toAddress, { "locale": locale }); } function handleErrors(){ if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS) alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_SERVER_ERROR) alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_MISSING_QUERY) alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code); // else if (gdir.getStatus().code == G_UNAVAILABLE_ADDRESS) <--- Doc bug... this is either not defined, or Doc is wrong // alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_BAD_KEY) alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_BAD_REQUEST) alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code); else alert("An unknown error occurred."); } function onGDirectionsLoad(){ // Use this function to access information about the latest load() // results. // e.g. // document.getElementById("getStatus").innerHTML = gdir.getStatus().code; // and yada yada yada... } </script> </head> <body onload="initialize()" onunload="GUnload()"> <h2>Maps API Directions Illustrated</h2> <form action="#" onsubmit="setDirections(this.from.value, this.to.value, this.locale.value); return false"> <table> <tr><th align="right">From: </th> <td><input type="text" size="25" id="fromAddress" name="from" value="San Francisco"/></td> <th align="right"> To: </th> <td align="right"><input type="text" size="25" id="toAddress" name="to" value="Mountain View" /></td></tr> <tr><th>Language: </th> <td colspan="3"><select id="locale" name="locale"> <option value="en" selected>English</option> <option value="fr">French</option> <option value="de">German</option> <option value="ja">Japanese</option> <option value="es">Spanish</option> </select> <input name="submit" type="submit" value="Get Directions!" /> </td></tr> </table> </form> <br/> <table class="directions"> <tr><th>Formatted Directions</th><th>Map</th></tr> <tr> <td valign="top"><div id="directions" style="width: 275px"></div></td> <td valign="top"><div id="map_canvas" style="width: 310px; height: 400px"></div></td> </tr> </table> <h2>Maps API Directions Illustrated 2nd Map</h2> <form action="#" onsubmit="setDirections2(this.from.value, this.to.value, this.locale.value); return false"> <table> <tr><th align="right">From: </th> <td><input type="text" size="25" id="fromAddress2" name="from" value="San Francisco"/></td> <th align="right"> To: </th> <td align="right"><input type="text" size="25" id="toAddress2" name="to" value="Mountain View" /></td></tr> <tr><th>Language: </th> <td colspan="3"><select id="locale" name="locale2"> <option value="en" selected>English</option> <option value="fr">French</option> <option value="de">German</option> <option value="ja">Japanese</option> <option value="es">Spanish</option> </select> <input name="submit" type="submit" value="Get Directions!" /> </td></tr> </table> </form> <br/> <table class="directions"> <tr><th>Formatted Directions</th><th>Map</th></tr> <tr> <td valign="top"><div id="directions" style="width: 275px"></div></td> <td valign="top"><div id="map_canvas" style="width: 310px; height: 400px"></div></td> </tr> </table> </body> </html> Hi, I'm trying to recreate Apple like product browser. Now I downloaded entire page from Apple web site and I was able to isolate CSS files and java script files responsible for creation of this browser. It works just fine on my computer. But when I pull out all the CSS files and group them as well as Java Script files it just wont work any more. CSS works just fine after I relink them to a page but Java Script wont. Any clue what might be a problem? By the way I'm not trying to steal it from Apple. I just need engine to see how it is done and then I will change design since there look doesn't feet well with my web site design. So I guess it is OK. I am setting up a store for stationery. One cool aspect is for the online user to be able to type in what they want on the stationery, choose the font, and hit a "PREVIEW" button, showing an exact preview of what it should look like. I am having trouble on how to do this. Virtuemart and its forums are useless and helpless. Joomla suprisingly doesn't have an extension for this. Looks like I'm gonna have to hard code this baby. What would the best angle be to attack this? Should I try some interactive flash/AS3 or some good ol JS? There will be over 500 products so I am trying to pick YOUR expert brain before I tackle this beast. Thanks for any input! I'm working on creating a jQuery book online that utilizes .animate to create nifty effects. I'm nearly finished with the initial animation and design, but have run across a pretty irritating snag. Have a look at http://notebook.dauidusdesign.com to see the problem. The trouble: When you click on the right arrow or hover to see the next page, all works exactly right. But, when you hover on the left arrow, the animation occurs on the wrong side of the page... it should occur on the left side and show the page behind it. I'm pretty sure it comes down to something in the code below, as that is where the majority of hover animations occur. For a look at the rest of the code, visit the site above, view the source and check out the file jquery.booklet.1.1.0.js. The code below begins at line 401. Thanks for the help! Code: //add page hover animations if(opts.hovers){ ctrlsN.hover( function(){ if(!busy && opts.curr+2 <= opts.pTotal-2){ //animate p2.stop().animate({right:5, 'width':opts.pWidth-140, 'height':opts.pHeight}, 800, opts.easing); p2wrap.stop().animate({left:"-5px"}, 800, opts.easing); p3.stop().animate({'left':opts.width-180, 'width':30, paddingLeft: 50}, 800, opts.easing); p3wrap.stop().animate({left:10}, 800, opts.easing); rhover = true; } }, function(){ if(!busy && opts.curr+2 <= opts.pTotal-2){ p2.stop().animate({right:0, 'width':opts.pWidth, 'height':opts.pHeight}, 800, opts.easing); p2wrap.stop().animate({left:0}, 800, opts.easing); p3.stop().animate({'left':opts.width, 'width':0, paddingLeft: 0}, 800, opts.easing); p3wrap.stop().animate({left:0}, 800, opts.easing); rhover = false; } } ); ctrlsP.hover( function(){ if(!busy && opts.curr-2 >= 0){ //animate p1.stop().animate({left:5, 'width':opts.pWidth-140}, 800, opts.easing); p1wrap.stop().animate({right:"-5px", 'right':opts.pWidthH-140}, 800, opts.easing); p0.stop().animate({'right':opts.width-180, left:100, 'width':80}, 800, opts.easing); p0wrap.stop().animate({right:10}, 800, opts.easing); lhover = true; } }, function(){ if(!busy && opts.curr-2 >= 0){ p1.stop().animate({left:0, 'width':opts.pWidth}, 800, opts.easing); p1wrap.stop().animate({right:0, 'right':opts.pWidthH}, 800, opts.easing); p0.stop().animate({'right':opts.width-0, left:0, 'width':0}, 800, opts.easing); p0wrap.stop().animate({right:0}, 800, opts.easing); lhover = false; } } ); } hi, im fairly new to javascript but i know the basics. im just wondering is there a possibility to make a search that will connect to my databse with a product list in it, and then display any matches to what the user searched for? help is always helpful Put in the wrong place. Please feel free to delete
Hi all, Just a quick question please, i'm a javascript & jquery newbie and need a little advice to what is probably an easy problem to fix. I'm trying to get this jquery product rotator to work. It advances automatically every 5 seconds with the following code: (there's 8 buttons below and above the main content window, clicking a button swaps the divs in the content window) $(document).ready(function(){ $("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs ("rotate", 5000, true); }); All i need it to do is to advance automatically as above but also advance the slider when a user hovers/mouse over a button, so the relevant content is displayed in the main window. The code to the whole slider is below, minus the CSS. A demo of the slider is he http://demo.webdeveloperplus.com/fea...ontent-slider/ Many thanks. <!-- Links to Jquery. Do not touch --> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js" ></script> <div> <!-- This Week's Offer Product Viewer Code Starts Here --> <script> $(document).ready(function(){ $("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs ("rotate", 5000, true); }); </script> <center> <div id="featured" > <ul class="ui-tabs-nav"> <li class="ui-tabs-nav-item ui-tabs-selected" id="nav-fragment-1"><a href="#fragment-1"><img src="/homepage/button1.jpg" width="187" height="125" alt="" /></a></li> <li class="ui-tabs-nav-item" id="nav-fragment-2"><a href="#fragment-2"><img src="/homepage/button2.jpg" width="187" height="125" alt="" /></a></li> <li class="ui-tabs-nav-item" id="nav-fragment-3"><a href="#fragment-3"><img src="/homepage/button3.jpg" width="187" height="125" alt="" /></a></li> <li class="ui-tabs-nav-item" id="nav-fragment-4"><a href="#fragment-4"><img src="/homepage/button4.jpg" width="187" height="125" alt="" /></a></li> <li class="ui-tabs-nav-item" id="nav-fragment-5"><a href="#fragment-5"><img src="/homepage/button5.jpg" width="187" height="125" alt="" /></a></li> <li class="ui-tabs-nav-item" id="nav-fragment-6"><a href="#fragment-6"><img src="/homepage/button6.jpg" width="187" height="125" alt="" /></a></li> <li class="ui-tabs-nav-item ui-tabs-selected" id="nav-fragment-7"><a href="#fragment-1"><img src="/homepage/button7.jpg" width="187" height="125" alt="" /></a></li> <li class="ui-tabs-nav-item" id="nav-fragment-8"><a href="#fragment-8"><img src="/homepage/button8.jpg" width="187" height="125" alt="" /></a></li> </ul> <!-- First Content --> <div id="fragment-1" class="ui-tabs-panel" style=""> <img src="/homepage/trade-deals.jpg" width="760" height="500" alt="" /> </div> <!-- Second Content --> <div id="fragment-2" class="ui-tabs-panel ui-tabs-hide" style=""> <img src="/about-us-main.gif" width="760" height="500" alt="" /> </div> <!-- Third Content --> <div id="fragment-3" class="ui-tabs-panel ui-tabs-hide" style=""> <img src="/homepage/button3.jpg" width="760" height="500" alt="" /> <div class="info" > <center><h2>Content </h2></center> </div> </div> <!-- Fourth Content --> <div id="fragment-4" class="ui-tabs-panel ui-tabs-hide" style=""> <img src="/homepage/button4.jpg" width="760" height="500" alt="" /> </div> <!-- Fifth Content --> <div id="fragment-5" class="ui-tabs-panel ui-tabs-hide" style=""> <img src="/homepage/trade-deals.jpg" width="760" height="500" alt="" /> </div> <!-- Sixth Content --> <div id="fragment-6" class="ui-tabs-panel ui-tabs-hide" style=""> <img src="/homepage/button6.jpg" alt="" width="760" height="500" /> </div> <!-- Seventh Content --> <div id="fragment-7" class="ui-tabs-panel ui-tabs-hide" style=""> <img src="/homepage/button7.jpg" alt="" width="760" height="500" /> </div> <!-- Third Content --> <div id="fragment-8" class="ui-tabs-panel ui-tabs-hide" style=""> <img src="/homepage/button8.jpg" alt="" width="760" height="500" /> </div> </div> Hey all, I have a simple example below showing how when I pass in the value of the value attribute of option node, and then use if operator to check whether parameter is a string or not, even though it's a string, it converts it to false boolean and triggers the else statement rather than calling a function: Code: <body> <select> <option value="createMsg">Add Message</option> <option value="removeMsg">Remove Message</option> </select> </body> Code: var menu = { handleMenu : function(callback){ if(callback === "string"){ menu[callback](); } else { console.log("Issue occurred") } }, createMsg : function(){ var content = document.createTextNode("Please give additional information."), heading = document.createElement("h1"); heading.appendChild(content); document.body.appendChild(heading); }, removeMsg : function(){ } } document.getElementsByTagName('select')[0].onchange = function(){ menu.handleMenu(this.value)}; callback should be a string so why is it saying otherwise? Thanks for response Hello Coding Forums, I am working on building a watch app for the Pebble smartwatch that works in combination with a Bluetooth light bulb that could trigger on and off functionality. I have bits of the source code from a the same bulb project someone started from another site that is coded Java, so I imported them into cloud pebble their java library. I've been working on this since last year and I'm wondering what at all could I be doing wrong. I get the "cards" to show up, but as far as a connection to the bulbs I have not established that yet. I've attached my source code and if anyone has any time to give me some pointers that would be appreciated massively. I know that Hubble worked on a similar project, to control lighting from a pebble smartwatch so I know it can be done. I've even tested this code with other developers who are experienced and they are also wondering why the connection does not take place. It would be really neat if I got this to work. Thank you everyone. Attached Thumbnails The title says it all really. An example of the cufon breaking is when I add a product to my cart, example here http://joemeetsjoy.com/products When you click buy now then click ok on the pop up box the cufon breaks. It also happens if you go the the shopping cart and choose a shipping option. Any ideas why this happens. Thanks I need help with the following code below. It just doesn't turn out okay. Any ideas? Code: function changing() { A = document.exempel.Amount.value B = ("<%#Container.DataItem("Price_2_qty")%>") C = ("<%#Container.DataItem("Price_3_qty")%>") D = ("<%#Container.DataItem("Price_4_qty")%>") E = ("<%#Container.DataItem("Price_5_qty")%>") if (A < B) {document.exempel.Price.value = "<%#Container.DataItem("Price_1")%>"} else if (A = B && (!(A >= C))) {document.exempel.Price.value = "<%#Container.DataItem("Price_2")%>"} else if (A = C && (!(A >= D))) {document.exempel.Price.value = "<%#Container.DataItem("Price_3")%>"} else if (A = D && (!(A >= E))) {document.exempel.Price.value = "<%#Container.DataItem("Price_4")%>"} else if (A >= E) {document.exempel.Price.value = "<%#Container.DataItem("Price_5")%>"} } This is probably easy if I knew Javascript. Can someone show me the code to get the number "800014352" part from the url???? http://testebiz/ebizbtest/ShoppingCa...2/Default.aspx I am trying to use some string functions with no results. It appear what I'm using them on are not strings. my_string = document.getElementById("link5").onclick; document.write(my_string.lastIndexOf("5")); This gets nothing! And document.write(document.getElementById("link5").onclick.lastIndexOf("5")); gets nothing. BUT if I make a string and put what the onclick is set to with: my_string = "function onclick(event) { reveal(\"5\", \"2\", \"1864\")"; then my_string.lastIndexOf("5") will yield 34. So why is my original my_string = not working? And how can I get it to work? I was looking at this page, and came across "%" used in strange context. It appears that the mod operator can be used in Strings?? http://download.oracle.com/javase/tu...vaOO/enum.html What does this do/ mean? Thanks!!: System.out.printf("Your weight on %s is %f%n", p, p.surfaceWeight(mass)); When comparing an empty string "" to another string like "1232", javascript is returning true. Why is that?
|