JavaScript - Execute Sql Oracle Query From A Javascript Script
HI peers,
i need to run a sql query fromjavascript onclick button and display data in a textarea . is this possible ? than you . Similar TutorialsHi peers,, i am passing oracle time stamp dates to javascript array element. the problem is i am unable to convert them to standard format : here is the date format i am getting from Oracle to javascript array : {ts '2011-03-15 00:00:00'} and here is what i want to get : 03/15/2011 Any help ? thanks All, I have a script that runs some jQuery and appends it to a <div>. I only want this script executed if a user is using IE7 or higher since jQuery doesn't work with IE6. How can I do that? Also, if they aren't using IE7 or higher I don't wnat to display the <div> that the results go into. How would I go about doing this? Thanks! Hi Everyone, I want to execute a script when the user clicks the button. Currently in my html doc. i have the button declared. <input type="button" id ="button" onclick='notEmpty() value="Play"/> When the button is clicked, i execute the notEmpty() function and I want to execute a script inside the notEmpty(). How can i do this? Thanks, Praveen I am wondering if its possible to execute a JavaScript script as soon as the page is loaded? Perhaps a generic execution? I tried this, but it didn't work: Code: <SCRIPT type="text/javascript"> if (document.forms["form"]["quantitym"].value > '.$row['sizem'].') { alert ("The quantity for product $row['id'] is no longer available."); } </SCRIPT> <FORM action="updatecart.html" method="post" name="form"> <DIV> <B>Medium:</B> <INPUT name="quantitym" value="'.$content['sizem'].'"> </DIV> </FORM> This is for my shopping cart system. The idea is, the customer might have 4 items in his cart, but whilst he was shopping, someone might of bought the same item, result in only 3 being available, but his cart still says 4. My solution to this is to make a script run through out his shopping when ever the cart items are listed and just prior payment execution, if the quantity he wants is no longer available, he will be alerted. $row['sizem'] is PHP drawing how many items there are from my stock database. If the value of the INPUT exceeds this availability, JavaScript shall alert. Does anyone know why it isn't alerting? Quote: Originally Posted by mlseim hmmm .... sort of stumped. For a test, I made a script that pulls a random "bumper-sticker" quote out of a file and sends it back as Javascript. Put this on a test page of yours and see what happens: <script type="text/javascript" src="http://www.catpin.com/bumper_sticker3.php"></script> Wherever that line is, when you view your web page, it should have a random quote. It's using the same code that I had above (in post #2). how would you put <script type="text/javascript" src="http://www.catpin.com/bumper_sticker3.php"></script> into a function for javascript to call this php file? Hi, I'm doing something wrong, I want my script to execute when the browser window opens, can someone please help me? Code: <p><iframe id="myFrame" style="display: none;" width="500" height="300"></iframe> <script type="text/javascript">// <![CDATA[ window.onload=openpdf(); type="text/javascript">// <![CDATA[ function openPdf() { var omyFrame = document.getElementById("myFrame"); omyFrame.style.display="block"; omyFrame.src = "myFile.pdf"; } // ]]></script> I wish to change the dynamic text in a javascript to that which is in a MySQL database using PHP. this is then used in a flash scroller. currently i have hard coded the text in the javascript file. is there a way to have PHP run in the javascript file before it is sent to the endusers? or another way ? Hi, I'd like to create a textarea and a division so that whatever embed code you put in the textarea it gets executed on the division in real-time. Your kind help is greatly appreciated! JavaScript newbie First off; i was in two minds if this belonged in the .php forum or the javascript forum; i apologize if i chose the wrong one. I have this .php code: PHP Code: <?php $query = "SELECT mail_id FROM ".TBL_MAIL." WHERE UserTo = '$session->username' and status = 'unread'"; $numUnreadMail = $database->query($query) or die(mysql_error()); $numUnreadMail = mysql_num_rows($numUnreadMail); if($numUnreadMail == 0){ echo '<img src="../images/global/mail_imgs/inbox_0.png" width="22" height="15" />';} if($numUnreadMail == 1){ echo '<img src="../images/global/mail_imgs/inbox_1.png" width="22" height="15" />';} if($numUnreadMail == 2){ echo '<img src="../images/global/mail_imgs/inbox_2.png" width="22" height="15" />';} if($numUnreadMail == 3){ echo '<img src="../images/global/mail_imgs/inbox_3.png" width="22" height="15" />';} if($numUnreadMail == 4){ echo '<img src="../images/global/mail_imgs/inbox_4.png" width="22" height="15" />';} if($numUnreadMail == 5){ echo '<img src="../images/global/mail_imgs/inbox_5.png" width="22" height="15" />';} if($numUnreadMail == 6){ echo '<img src="../images/global/mail_imgs/inbox_6.png" width="22" height="15" />';} if($numUnreadMail == 7){ echo '<img src="../images/global/mail_imgs/inbox_7.png" width="22" height="15" />';} if($numUnreadMail == 8){ echo '<img src="../images/global/mail_imgs/inbox_8.png" width="22" height="15" />';} if($numUnreadMail == 9){ echo '<img src="../images/global/mail_imgs/inbox_9.png" width="22" height="15" />';} if($numUnreadMail == 10){ echo '<img src="../images/global/mail_imgs/inbox_10.png" width="22" height="15" />';} if($numUnreadMail == 11){ echo '<img src="../images/global/mail_imgs/inbox_11.png" width="22" height="15" />';} if($numUnreadMail == 12){ echo '<img src="../images/global/mail_imgs/inbox_12.png" width="22" height="15" />';} if($numUnreadMail == 13){ echo '<img src="../images/global/mail_imgs/inbox_13.png" width="22" height="15" />';} if($numUnreadMail == 14){ echo '<img src="../images/global/mail_imgs/inbox_14.png" width="22" height="15" />';} if($numUnreadMail == 15){ echo '<img src="../images/global/mail_imgs/inbox_15.png" width="22" height="15" />';} if($numUnreadMail == 16){ echo '<img src="../images/global/mail_imgs/inbox_16.png" width="22" height="15" />';} if($numUnreadMail == 17){ echo '<img src="../images/global/mail_imgs/inbox_17.png" width="22" height="15" />';} if($numUnreadMail == 18){ echo '<img src="../images/global/mail_imgs/inbox_18.png" width="22" height="15" />';} if($numUnreadMail == 19){ echo '<img src="../images/global/mail_imgs/inbox_19.png" width="22" height="15" />';} if($numUnreadMail == 20){ echo '<img src="../images/global/mail_imgs/inbox_20.png" width="22" height="15" />';} //Middle Section echo '</a> <div id="m1" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">'; if($session->isAdmin()){ echo '<a href="http://localhost/admin/admin_mailinbox.php">View Inbox ';} else{ echo '<a href="http://localhost/mailinbox.php">View Inbox ';} //Displays the correct number on drop tab if($numUnreadMail == 0){ echo ' ';} if($numUnreadMail == 1){ echo '(01)';} if($numUnreadMail == 2){ echo '(02)';} if($numUnreadMail == 3){ echo '(03)';} if($numUnreadMail == 4){ echo '(04)';} if($numUnreadMail == 5){ echo '(05)';} if($numUnreadMail == 6){ echo '(06)';} if($numUnreadMail == 7){ echo '(07)';} if($numUnreadMail == 8){ echo '(08)';} if($numUnreadMail == 9){ echo '(09)';} if($numUnreadMail == 10){ echo '(10)';} if($numUnreadMail == 11){ echo '(11)';} if($numUnreadMail == 12){ echo '(12)';} if($numUnreadMail == 13){ echo '(13)';} if($numUnreadMail == 14){ echo '(14)';} if($numUnreadMail == 15){ echo '(15)';} if($numUnreadMail == 16){ echo '(16)';} if($numUnreadMail == 17){ echo '(17)';} if($numUnreadMail == 18){ echo '(18)';} if($numUnreadMail == 19){ echo '(19)';} if($numUnreadMail == 20){ echo '(20)';} ?> which displays in this navigation: <li><a href="#" onmouseover="mopen('m1')" onmouseout="mclosetime()" class="link_image"> <?php include_once('../include/mailicon_codes.php'); ?> </a> I wondered how or if it is even possible to use javascript to execute the first .php code so that the user would know if he/she had a new message without refreshing the page? Any help is greatly appreciated as i suck at .js cheers, Callum FF, Safari, Opera all execute this javascript code to refresh the page properly, but in IE version 8.0.6001.18904 the page doesn't seem to refresh on click of orange_refresh button. I have checked out a different version of IE8, don't recall exact version, but it did seem to work fine in that one, whatever version it was probably the latest now that I think of it. Check out code below any sug.'s could be helpful, though its probably a bug.. Code: <a href="javascript:document.location.reload();" onmouseover="window.status='Refresh'; return true" onmouseout="window.status='Page Refreshed'"><img src="image/orange_refresh.png" width="30" height="30" border="0" /></a> Hi, please tell how to dynamically insert items in list box in javascript.That is . When ever new element in stored in oracle that should be listed in listbox Hi There, I'm working on an application that potentially gets 1000s of geolocation queries per day and if I don this (as I've done it till now) in php, it works fine but I quickly run into OVER_QUERY_LIMIT error from the google map apis. Thus I think I'd better do it in javascript and just send the coordinates to the server for caching rather than querying from the server's IP. Now the url that sends back the location information looks like this: http://www.google.com/url?sa=D&q=htt...s3czv6-nMr_nbw and I was wondering how I can send a request to this url and parse the xml string that's returned with JavaScript to pass it on to a php (probably by get variables). Is there a handy method that's compatible accross a bunch of browsers incl. mobile ones? Thanks very much for some input! Ron Hi I am trying to get javascript to update a database for me. The reason is I need to use JS and not ASP is because I need to update whenever a user clicks on a button and from what I am told ASP can not do this. I tried following an example, and this is what I came up with. However I get the errors Error: Object expected and Excptected Hexadecimal Digit. Here is the code Code: <script language=javascript> function update() { var adoConn = new ActiveXObject("ADODB.Connection"); var adoRS = new ActiveXObject("ADODB.Recordset"); adoConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source='\\data\user.mdb'"); adoRS.Open("Select * From ptotbl Where ID = 454"); adoRS.Edit; adoRS.Fields("Delete").value = "True"; adoRS.Update; adoRS.Close(); adoConn.Close(); } Thanks Hello I'm trying to create a graph that will accept 1 or multiple data sets depending on what the user selects. How can I add get the data into the graph using a loop? I want it to add a line for each selection. Thanks // Graph Data ############################################## var graphData = [{ // Visits data : <?php echo '['.implode($data).'],'?> color: '#71c73e' }, { // Visits data : <?php echo '['.implode($data_1).'],'?> color: '#red' }, ]; Hi I am trying to create a query string similar to the one available he http://andrewu.co.uk/tools/request/e.../example1.html The problem that I am having is that I have more than one button on my page and even though my id's are unique all of my data is displaying on the action page at the same time. The code that i am using for my buttons is: Code: <label for="name_1">Name:</label> <input type="text" name="name1" id="name_1" tabindex="1" size="40" value="Donald Duck" /> <br /> <br /> <input type="submit" id='view1' value="Submit" tabindex="2" /> <label for="name_1">Name:</label> <input type="text" name="name2" id="name_2" tabindex="1" size="40" value="Mickey Mouse" /> <br /> <br /> <input type="submit" id='view2' value="View" tabindex="2" /> I have a lot more than 2 buttons on my page. when a button is clicked I would like to be able to get the values from the query string and only see the values for the button that was clicked like this one: http://andrewu.co.uk/tools/request/e...ndrew+Urquhart but instead I am getting Name: Donald Duck, Name: Mickey Mouse. What would I have to add or change to obtain just one Name to display at a time but have it be different depending on which button is pressed? Hi guys, been running into some problems with all IE browsers and my jQuery Gallery from Galleryview. Background: I am using Java to do an image search and build up some HTML including the calls to run the galleryview scripts and return this back to the page using document.write() When I use the simple structure of placing the scripts and parameters into a sample page: Code: Code: <body> <script type="text/javascript" src="http://spaceforaname.com/js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="http://spaceforaname.com/js/jquery.easing.1.3.js"></script> <script type="text/javascript" src="http://spaceforaname.com/js/jquery-galleryview-1.1/jquery.galleryview-1.1.js"></script> <script type="text/javascript" src="http://spaceforaname.com/js/jquery-galleryview-1.1/jquery.timers-1.1.2.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#photos').galleryView({ panel_width: 800, panel_height: 300, frame_width: 100, frame_height: 100 }); }); </script> It works fine. When I try and pull all the scripts out of the page and inject them back in using document.write() I get an error on IE: Code: Code: sb.append("(function(){ document.write('" + " <script type=\"text/javascript\" src=\"http://spaceforaname.com/js/jquery-1.3.2.min.js\"></script> " + " <script type=\"text/javascript\" src=\"http://spaceforaname.com/js/jquery.easing.1.3.js\"></script> " + " <script type=\"text/javascript\" src=\"http://spaceforaname.com/js/jquery-galleryview-1.1/jquery.galleryview-1.1.js\"></script> " + " <script type=\"text/javascript\" src=\"http://spaceforaname.com/js/jquery-galleryview-1.1/jquery.timers-1.1.2.js\"></script> " + " <script type=\"text/javascript\"> " + " $(document).ready(function(){ " + " $(\"#photos\").galleryView({ " + " panel_width: 800, " + " panel_height: 300, " + " frame_width: 100, " + " frame_height: 100 " + " }); " + " }); " + " </script> " +............+ "')})()"); The variable sb is a StringBuffer and is formatted and returned: Code: Code: nextPage.setValue(sb.toString()); nextPage.setEscapeHTML(false); return nextPage; This particular error in this case in IE(8) is: Object expected which I think is referring to the jQuery as the resulting images are displayed just not in Galleryview style. This is really wracking my brains and any and all help is appreciated. D. I have noooo idea if I am even posting this in the correct area, let alone the correct site. If not I apologize and maybe someone could direct me elsewhere. I am trying to add a custom search into my site. http://www.jeffknowsloans.com you can see it about the middle of the page. I am using the following script to do so. Code: <script type="text/javascript"> function dosearch() { var sf=document.searchform; var submitto = sf.sengines.options[sf.sengines.selectedIndex].value + escape(sf.searchterms.value); window.location.href = submitto; return false; } </script> <form name="searchform" onSubmit="return dosearch();"> Select County <select name="sengines"> <option value="http://www2.co.washington.mn.us/opip/mod/addresssrch/result.asp?housenum=&street=" selected>Washington</option> <option value="http://rrinfo.co.ramsey.mn.us/public/characteristic/PropertySearchResults.aspx?pin=&Nbr=&Street=&pg=1" selected>Ramsey</option> <option value="http://www.altavista.com/web/results?q=">Alta Vista</option> <option value="http://www.dogpile.com/info.dogpl/search/web/">Dogpile</option> </select> Street Address: <input type="text" name="searchterms"> <input type="submit" name="SearchSubmit" value="Search"> </form> here is the problem i am running into. I dont know how to ignore or add certain parts of the search when it sends. for example. take a look at Code: <option value="http://rrinfo.co.ramsey.mn.us/public/characteristic/PropertySearchResults.aspx?pin=&Nbr=&Street=&pg=1" selected>Ramsey</option> When i try to do a search under this drop down selection it doesnt work. because it needs the &pg=1 to be added to the users search request. Meaning if I set it to Code: http://rrinfo.co.ramsey.mn.us/public/characteristic/PropertySearchResults.aspx?pin=&Nbr=&Street= they type in their street name and the street name inputs into the search query but it wont fully work because it doesnt add the &pg=1 after it all. how in the world do I get it to add things like that? ie how do i tell it to add certain strings that the outside source requires? like blank=&blank= or how do i get it to ignore certain &blank= commands. another example taking a look at Code: <option value="http://www2.co.washington.mn.us/opip/mod/addresssrch/result.asp?housenum=&street=" selected>Washington</option> this search function should technically be Code: <option value="http://www2.co.washington.mn.us/opip/mod/addresssrch/result.asp?" selected>Washington</option> however since i dont know how to add certain functions to the search i have to skip the housenum option. that means my customers cant search by street number. I want them to be able to type in their house number and their street address and it will change to what each seperate (outside) search engine needs. Does this make any sense at all? |