Jump to content

Search the Community

Showing results for tags 'ajax'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 119 results

  1. I have an xml blog and a javascript file i am trying to use to publish this blog to a website with. I am just testing to see if AJAX is working at all because i have been having issues with this for a day now. Here is the Javascript code: function blog(){var xhr = new XMLHttpRequest(); xhr.onReadyStateChange = function(){if(xhr.readyState == 4 && xhr.status == 200){var xmldom = xhr.responseXML;alert(xmldom.documentElement);}} xhr.open("GET","blog.xml",true);xhr.send();} Here is the xml code: <?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><item><title>hello</title> <link>www.google.com</link> <description>world</description></item><item><title>hello</title> <link>www.google.com</link> <description>world</description></item><item><title>hello</title> <link>www.google.com</link> <description>world</description></item></channel> </rss> Finally, here is the HTML code: <div id="blog"><h4>News Updates</h4><script type="text/javascript" src="blog.js" async></script><button type="button" onclick="blog()">click me</button></div> I have it set up to where the button in the HTML code has the onclick event listener that calls the javascript "blog()" function. the problem is that i never does anything NO MATTER WHAT I DO. it is always unresponsive. I never get a single alert box no matter what i make the script do inside the onreadystate function.
  2. sepoto

    Twitter.

    I have this code that does some AJAX to go back into my database and extract an array of bars. I have developed the code to change one of my div's to display all the data for each bar. In addition to displaying the data I also need to modify the contents of #latestFromDSGbuffer to contain a twitter feed of 5 tweets each per bar that was queried. I have tried a number of samples but for some reason I am able to get the twitter samples working in a sandbox but when I try to integrate that code things don't seem to be working out. I don't know if maybe that is because I was trying to call $.ajax(); inside of the callback function from another $.ajax(). Maybe the design needs to be modified? Maybe I should use some DOM storage to store barLocations? I'm wondering what to do with it. All of the data is located in "barLocations". Although I have attempted to make "barLocations" "global" I am not able to access it from within button.onclick where it is showing as "undefined". $.ajax({ url: 'ajax.php', data: { lat: results[0].geometry.location.lat(), lng: results[0].geometry.location.lng(), radius: radius }, type: 'post', success: function(output) { barLocations = $.parseJSON(output); //alert(obj[0].lat); /* So now that we have the JSON encoded array it has to be displayed into one of the div's probably below the map someplace */ var newInnerHTML = ""; for(var i = 0; i < barLocations.length; i++) { newInnerHTML = newInnerHTML + "<strong>" + barLocations[i].company + "</strong></br>"; newInnerHTML = newInnerHTML + barLocations[i].first_name + " " + barLocations[i].last_name + "</br>"; newInnerHTML = newInnerHTML + barLocations[i].street_address1 + "</br>" + barLocations[i].street_address2 + "</br>" + barLocations[i].city + "</br>"; newInnerHTML = newInnerHTML + "Phone: " + barLocations[i].phone_number + "</br>"; newInnerHTML = newInnerHTML + "Email: " + barLocations[i].email + "</br>"; newInnerHTML = newInnerHTML + "Website: " + barLocations[i].website + "</br>"; newInnerHTML = newInnerHTML + "<a href=\"standardprofile.php\" target=\"_blank\">Profile page >>>></a>"; newInnerHTML = newInnerHTML + "</br></br>"; } for (i = 0; i < barLocations.length; i++) { var markerImage = 'image/baricon.png'; marker = new google.maps.Marker({ position: new google.maps.LatLng(barLocations[i].lat,barLocations[i].lng), map: map, icon: markerImage, title: barLocations[i].company }); } if(barLocations.length > 0) { document.getElementById('divBarLocations').innerHTML = newInnerHTML; } } }); Thanks in advance for any help comments or commentary. Your input is most welcome... The whole code looks more like this: (function() { var map, geocoder, marker, infowindow, barLocations; window.onload = function() { $('#hdivBarLocations').hide(); // Creating a reference to the mapDiv var mapDiv = document.getElementById('map'); // Creating a latLng for the center of the map var latlng = new google.maps.LatLng(37.09, -95.71); // Creating an object literal containing the properties // we want to pass to the map var options = { center: latlng, zoom: 4, mapTypeId: google.maps.MapTypeId.ROADMAP }; // Creating the map map = new google.maps.Map(mapDiv, options); // Getting a reference to the HTML form var button = document.getElementById('addressButton'); // Catching the forms submit event button.onclick = function() { button.disabled = true; // Getting the address from the text input var address = document.getElementById('addressBox').value; var radius = document.getElementById('radialDistance').value; // Making the Geocoder call getCoordinates(address, radius); // Preventing the form from doing a page submit //return false; $('#hdivBarLocations').show(); } } // Create a function the will return the coordinates for the address function getCoordinates(address, radius) { // Check to see if we already have a geocoded object. If not we create one if(!geocoder) { geocoder = new google.maps.Geocoder(); } // Creating a GeocoderRequest object var geocoderRequest = { address: address } // Making the Geocode request geocoder.geocode(geocoderRequest, function(results, status) { // Check if status is OK before proceeding if (status == google.maps.GeocoderStatus.OK) { //Go back in for some data. document.getElementById('divBarLocations').innerHTML = "No bars found in your area..."; $.ajax({ url: 'ajax.php', data: { lat: results[0].geometry.location.lat(), lng: results[0].geometry.location.lng(), radius: radius }, type: 'post', success: function(output) { barLocations = $.parseJSON(output); //alert(obj[0].lat); /* So now that we have the JSON encoded array it has to be displayed into one of the div's probably below the map someplace */ var newInnerHTML = ""; for(var i = 0; i < barLocations.length; i++) { newInnerHTML = newInnerHTML + "<strong>" + barLocations[i].company + "</strong></br>"; newInnerHTML = newInnerHTML + barLocations[i].first_name + " " + barLocations[i].last_name + "</br>"; newInnerHTML = newInnerHTML + barLocations[i].street_address1 + "</br>" + barLocations[i].street_address2 + "</br>" + barLocations[i].city + "</br>"; newInnerHTML = newInnerHTML + "Phone: " + barLocations[i].phone_number + "</br>"; newInnerHTML = newInnerHTML + "Email: " + barLocations[i].email + "</br>"; newInnerHTML = newInnerHTML + "Website: " + barLocations[i].website + "</br>"; newInnerHTML = newInnerHTML + "<a href=\"standardprofile.php\" target=\"_blank\">Profile page >>>></a>"; newInnerHTML = newInnerHTML + "</br></br>"; } for (i = 0; i < barLocations.length; i++) { var markerImage = 'image/baricon.png'; marker = new google.maps.Marker({ position: new google.maps.LatLng(barLocations[i].lat,barLocations[i].lng), map: map, icon: markerImage, title: barLocations[i].company }); } if(barLocations.length > 0) { document.getElementById('divBarLocations').innerHTML = newInnerHTML; } } }); circ = null; var circ = new google.maps.Circle({ map: map, radius: radius * 1609.344 }); circ.setCenter(results[0].geometry.location); // Center the map on the returned location map.setCenter(results[0].geometry.location); map.fitBounds(circ.getBounds()); google.maps.event.trigger(map,'dragend'); var markerImage = 'image/home.png'; // Check to see if we've already got a Marker object if (!marker) { // Creating a new marker and adding it to the map marker = new google.maps.Marker({ map: map, icon: markerImage }); } // Setting the position of the marker to the returned location marker.setPosition(results[0].geometry.location); // Check to see if we've already got an InfoWindow object if (!infowindow) { // Creating a new InfoWindow infowindow = new google.maps.InfoWindow(); } // Creating the content of the InfoWindow to the address // and the returned position var content = '<span style="color: black;">Your location.</span>'; // Adding the content to the InfoWindow infowindow.setContent(content); // Opening the InfoWindow infowindow.open(map, marker); } }); }})();
  3. So I have been studying this code and I have read a bit about the callback function: xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 4) { HandleResponse(xmlHttp.responseText); } } is asynchronous although I'm not fully sure exactly what that means to me at this point. Essentially I am starting with a page bars.php: <!DOCTYPE html><html><head><title>Daily Sports Guide Bars</title><link type="text/css" rel="stylesheet" href="style/style.css"><link type="text/css" rel="stylesheet" href="style/suckerfish.css"><style>#map { width: 80%; height: 500px; border: 1px solid #000; margin-left: 10%; }</style><script type="text/javascript" src="js/ajax.js"></script><script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script><script>(function() { window.onload = function() { var responseText = MakeRequest(); alert(responseText); // Creating a reference to the mapDiv var mapDiv = document.getElementById('map'); // Creating a latLng for the center of the map var latlng = new google.maps.LatLng(37.09, -95.71); // Creating an object literal containing the properties // we want to pass to the map var options = { center: latlng, zoom: 4, mapTypeId: google.maps.MapTypeId.ROADMAP }; // Creating the map var map = new google.maps.Map(mapDiv, options); }})();</script></head><body><div id="wrapper"><?php require('includes/i_header.php'); ?><div style='margin: 0px; padding: 0px; text-align: center;'><img height="100" width="413" src="image/underconstruction.gif"></div><div id="map"></div><?php require('includes/i_footer.php'); ?></div></body></html> So I guess the first thing would be to also list the contents of my ajax.js: function getXMLHttp(){ var xmlHttp try { //Firefox, Opera 8.0+, Safari xmlHttp = new XMLHttpRequest(); } catch(e) { //Internet Explorer try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { alert("Your browser does not support AJAX!") return false; } } } return xmlHttp;} function MakeRequest(){ var xmlHttp = getXMLHttp(); xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 4) { HandleResponse(xmlHttp.responseText); } } xmlHttp.open("GET", "ajax.php", true); xmlHttp.send(null); return xmlHttp.responseText;} function HandleResponse(response){ alert(response);} I am not sure at all of my design here but my intent would be (in bars.php that is): var responseText = MakeRequest();alert(responseText); in this case to get MakeRequest to return into 'responseText' the value in ajax.php which is: <?phpecho "This is a php response to your request!!!!!!";?> So maybe it just is not the right design or maybe I just can't make this work because I don't really understand the internals of it all yet. I do get the first alert from HandleResponse however what I can't figure out is how to get that data back into my mapping area. How should this be done? Thanks so much. As always any help from the forums is most welcome.
  4. hey guys Basically i am trying to create a validation for the form. I want it to check if it can connect to the DB and if true to proceed to another page and if false to return an error. I am inputting the wrong details to make it just display the error but somehow it always returns "TRUE" on page load... and everytime i click the submit it doesnt do anything regardless of my entry... Can anyone tell me why? <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){var u = $('#username');var s = $('#server');var p = $('#password'); $('#iValForm').submit($.post("connect.php", {u: u.val(),p: p.val(),s: s.val()}, function(fd){ if (fd == "true"){ alert("Is: " + fd); return false; } // if1 if (fd == "false"){ alert("Is2: " + fd); return false; } // if2} //post function) //Post) //submit }) //document </script></head> <body> <form class="iValForm" id="iValForm" method="post" action=""><fieldset><legend id="error"> </legend><p><label for="username">Username </label><input id="username" name="username" class="required" /> </input></p><p><label for="password">Password</label> <input id="password" name="password" class="required"/> </input></p><p><label for="server">Server</label> <input id="server" name="server" class="required"/> </input></p><p> <input class="submit" id ='submit' type="submit" value="Submit"/></p></fieldset></form> connect.php <?php$user = $_POST['u'];$password = $_POST['p'];$server = $_POST['s'];@$con = mysql_connect ($server, $user, $password); if (!$con) {$response = 'false';echo $response;} else { $response = 'true'; echo $response;}?>
  5. tinfanide

    A question about global variable?

    <html><!--php_json.php--><head><script src="json2.js"></script><script src="php.js"></script><script>ajax("php_json.json",function(){oJSON = JSON.parse(xmlhttp.responseText);sJSON = JSON.stringify(oJSON);/*put it hereokay*/});// here, the variable sJSON is undefinedajax("php.php?json="+sJSON,function(){ alert(xmlhttp.responseText); });//</script></head><body></body></html> // php.jsfunction ajax(source,func){xmlhttp = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP") ? new ActiveXObject("Msxml2.XMLHTTP") : null ;xmlhttp.onreadystatechange = function(){ (xmlhttp.readyState == 4 && xmlhttp.status == 200) ? func() : null ; }xmlhttp.open("GET",source,true);xmlhttp.send();} wanna ask how to extend the scope of the variable sJSON to be global?
  6. var ajax = function(query){xmlhttp = (window.XMLHttpRequest) ? xmlhttp=new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP") ? new ActiveXObject("Msxml2.XMLHTTP") : null ;xmlhttp.onreadystatechange = function(){ jsonData = JSON.parse(xmlhttp.responseText); (xmlhttp.readyState==4 && xmlhttp.status==200) ? func(query) : null ; }xmlhttp.open("GET","lib.json",true);xmlhttp.send();} function func(query){ // fail to check an undefined AJAX responseTextif(typeof(xmlhttp.responseText)=="undefined" && xmlhttp.responseText != null){ alert(0); }else { document.getElementById("result").innerHTML = jsonData[1][query]; }} This is the testing page:http://lifelearning.xtreemhost.com/lib.html Just wanna ask how to check an undefined AJAX responseText.Many thanks.
  7. tinfanide

    return responseText = undefined?

    <script>function ajax(){xmlhttp = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP") ? new ActiveXObject("Msxml2.XMLHTTP") : null ;xmlhttp.onreadystatechange = function(){ var jsonData = eval("("+xmlhttp.responseText+")"); return (this.readyState == 4 && this.status == 200) ? jsonData[1][1] : null ;}xmlhttp.open("GET","json.json",true);xmlhttp.send(null);} window.onload function func(){document.getElementById(elem).innerHTML = ajax(); // return undefined}</script> Is there a syntax mistake that produces the undefined result?
  8. sumbin

    AJAX form submit

    hi..everyone!!!!!!!!iam trying to submit a form which has approx 10 text fields with ajax. but iam unable to write the code. please help!!!!!!!!!!!!!! in this regard thanksSuman
  9. I have this php script stop.php <?phpinclude('ssh_con.php');$stop = 'screen -S testapplication -X quit';ssh2_exec($con, $stop);mysql_query("UPDATE servers SET Online=0 WHERE Owner='".$_SESSION['Username']."'");echo "<meta http-equiv='refresh' content='0;index.php'>";?> now i want to execute/call/get this page/script using javascript onclick to execute the code and the page refreshes itself. Can anyone guide me to do this? Thanks before hand.
  10. I'm building this web site for a CS major career for a college. I'm working on the login part now, but I thought it would be really cool and efficient (I assume) if instead of redirecting the user to another html page to do all the login information, to just do like most websites do now, dim the background to a dark color and pop-up a form with the username and password.. I know that has something to do with ajax and some javascript.. But the problem is that I've been looking for resources or tutorials on how to do it, but I haven't found one yet. If someone has any tutorial link, or any information on how to do this I would be really grateful!
  11. jemz

    my simple ajax don't work

    Hi, I need some help please on this ajax,and i am still beginner on this.I created a simple page as my practice using ajax enabled.my problem is that it will not insert into my table.can you help me please what is the problem of my code. testajax.php <html><head> <script type="text/javascript"> function InsertDoc() { var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById('display').innerHTML=xmlhttp.responseText; } } var name = encodeURI(document.getElementById('name').value); var email = encodeURI(document.getElementById('email').value); var address = encodeURI(document.getElementById('address').value); xmlhttp.open("GET","dbconn.php?name="+name+"&email="+email+"&address="+address,true); xmlhttp.send(); }</script></head> <body> <form > Name : <input type="text" id="name"> <br/> Email : <input type="text" id="email" > <br/> Address: <input type="text" id="address" > <br/><input type="submit" value="submit" onclick ="lnsertDoc();"> </form> <div id="display"></div> </body> </html> "dbconn.php" <?php $conn = mysql_connect('localhost','root',''); if(!$conn) { die("could not connect to localhost" .mysql_error());} mysql_select_db('dbajax',$conn); if (isset($_GET['name']) && isset($_GET['email']) && isset($_GET['address'])) { $name = $_GET['name']; $email = $_GET['email']; $address = $_GET['address']; $sql = "insert into ajaxTBl values('default', '$name', '$email', '$address')"; mysql_query($sql); echo "Successfully inserted"; } ?> Thank you in advance.
  12. Hello. I am very stuck at one point in my web-page project, and I hope that anyone of you can help me. In short, I'm trying to achieve an AJAX-like effect in a SVG-document. What I mean is that when the SVG-document (in my example below called SVGPage.php) has finished loading and is just sitting there waiting, I want to use AJAX on the click of an SVG-element (in my example the rectangle) to send a request to an external PHP-file (in my example called UpdateSVGPage.php).This "UpdateSVGPage.php" is building up SVG-code based on information from a database, and it will echo it back to the SVG-document via the same AJAX-request.The newly received SVG-code is deployed to a specific element in the SVG-code (in my example a <g>-element with the id="new_svg_shape"), and the new shape is instantly rendered and view-able on the SVG image.When the user clicks on the specific shape once again, the whole process should be repeated (meaning that a change in the database would create a different SVG-image). I have made an attempt below (which is not working), and I hope that my intentions are understandable. index.php <?phpsession_start();?><!DOCTYPE html><html> <head> </head> <body> <embed src="SVGPage.php" type="image/svg+xml" width="1000px" height="1000px"/> </body> </html> UpdateSVGPage.php <?phpsession_start(); //get the q parameter from URL $q=$_POST["input"]; echo "<rect x=\"1200\" y=\"233\" width=\"80\" height=\"20\" fill=\"blue\" />"; ?> SVGPage.php <?phpsession_start();header('Content-Type: image/svg+xml');print('<?xml version="1.0" standalone="no"?>');?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"> <script type="text/ecmascript" xlink:href="Library.js"/> <script type="application/ecmascript" > <![CDATA[ function ajax_function(){ var xmlhttp; if (window.XMLHttpRequest){ xmlhttp=new XMLHttpRequest(); } xmlhttp.onreadystatechange=function(input){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById("new_svg_shape").firstChild.data=xmlhttp.responseXML; } } xmlhttp.open("POST","UpdateSVGPage.php?q="+input,true); xmlhttp.send(); } ]]> </script> <rect height="100" width="100" fill="blue" onclick="ajax_function()"> </rect> <g id="new_svg_shape" /> </svg> A big thanks to anyone who might help me !
  13. First i have 2 files, index.html and check.php, the index's source is:index.html <html><head> <title>potatoes</title> <style type="text/css">@-webkit-keyframes potatointro {0% { opacity: 0; }100% { opacity: 1; }}.potato {-webkit-animation: potatointro 1s;}</style> <script type="text/javascript">function loadXMLDoc() {var xmlhttp;if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest();}else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById('potatoes').innerHTML = xmlhttp.responseText + document.getElementById('potatoes').innerHTML; }}xmlhttp.open("GET","check.php",true);xmlhttp.send();}</script></head><body> <div id="potatoes"> <div class="potato"> <p>abc</p> </div> </div></body></html> the check.php may return this: <div class="potato"> <p>def</p> </div> but at times also multiple ones: <div class="trade"> <p>ghi</p> </div> <div class="trade"> <p>def</p> </div> running loadXMLDoc() changes the body of index.html from <body> <div id="potatoes"> <div class="potato"> <p>abc</p> </div> </div></body> to <body> <div id="potatoes"> <div class="potato"> <p>def</p> </div> <div class="potato"> <p>abc</p> </div> </div></body> and that is EXACTLY what is supposed to happen, BUT as you see on the style i have a little kind of "intro" and instead of just doing that animation on the inserted part it does it on the existing ones too. i've been struggling around with insertBefore() and appendChild() and more but just can't do what i want to do.I'm kinda trying to get the effect of a timeline like in twitter, facebook or youtube when there is a new tweet/post/comment. I hope i've been clear enough and anyone could help. If there are any questions ofcourse feel free to ask.Any help would be welcome before i'll pull my hair out Edit: to clarify, i'm trying to recreate the effect like in https://twitter.com/...s/widget_search.
  14. Ok friends: I'm totally stuck, and I desperately need some guidance from you professionals. For the last couple of months I've been working on a web-page project.This is what I've got so far: - I've got a HTML5 page (index.php)- In this HTML5 page, I've got an embedded SVG-file, which is converted to a PHP-file (drawing.php)- It is converted to PHP, because it uses some data in a database to decide what the SVG-image should look like.- In this SVG-file, a PHP-script builds some graphics, and applies some animations to it.- The SVG-file also has a javascript-library attached to it, which I need for zooming and panning the SVG-image. Everything is fine so far, however now starts the problems:I've got some other data in my database, which is supposed to be displayed on the SVG-image only after the user clicks on a specific shape belonging to the SVG-image. The only possible way I could imagine this to work would be to use AJAX, however I have no idea how to use AJAX together with an embedded SVG-file.Googling for days hasn't help me too much either. I would be very grateful to anyone who could provide some help.
  15. Hello,I'm using this script right now:mainpage.php <?php$mainpage = 'secret';?><a href="#" id="renamegroups">Rename groups</a><div id='renamegroupsl'></div> <script type="text/javascript">$('#renamegroups').click(function(){ $("#renamegroupsl").load("../information/renamegroups.php"); return false;});</script> renamegroups.php <?phpecho $mainpage;?> The problem is that I get this error:Notice: Undefined variable: mainpage in (...)So how could I include a file with ajax / jquery (because if I include the file this will work and the error won't show up) Thanks!
  16. Hello!!! I am working on a chat developed with Ajax.I am trying to add emoticons to a chat on my site.I am planning to transfom them into text before sending them to the database. This is okay and i know how to do it.The problem is when I want to display those emoticons (along with text) on a div, after querying the data base.I don't know how to transform the text into images.I guess I have to use the Replace function or a similar one, but i don't know how to do it with images. this is what I have, the function which send the data to another page and get the response.I am using appendChild because I want the new texts to be placed after the previous ones. ....//the image/s I want to display:var imagen=new Imagen();imagen.src="http://www.websmileys.com/sm/sad/239.gif";....xmlhttp.onreadystatechange=function() {if(xmlhttp.readyState==4 && xmlhttp.status==200) {/* get here the response after having visited the page chatter.php*/ newdiv.innerHTML =xmlhttp.responseText; } }//I create a new element to put the new data:var add=document.createElement("div");var newdiv = add;//the element I already have on HTML:var container = document.getElementById("iddiv");container.appendChild(newdiv);xmlhttp.open("GET","chatter.php",true);xmlhttp.send();.......} Let's suppose I have some text like: uwyeruw--qweoo00, that I want to transform into the image above.How can i do that and send it along the rest of the text, into the newdiv variable? Thank you very much in advance, for any hint and for reading my post. Regards
  17. subhki2000

    Free Php Video Tutorials

    Hello Friends I have to visit a website which offers you Free Videos on various topics.Some Links I am posting here.AJAXhttp://learnerstv.com/Free-Computers-Video-lectures-ltv322-Page1.htmFundamentals of PHPhttp://learnerstv.com/Free-Computers-Video-lectures-ltv166-Page1.htmBasics of PHPhttp://learnerstv.com/Free-Computers-Video-lectures-ltv427-Page1.htm Regards,Er. Sumit Machra[+91-9414475695][http://brahmansh.in]
  18. Hi guysI am working on something tricky about display an image under the date text inside the cell in jquery calendarI don't mind about the plug-in of Jquery, My question is how we can assign a certain data for a cell date in the calendar assuming I have an array of values from the database and I want to assign each array element for a specific date? any idea?thanks in advance for any help
  19. Zaper Gallis

    Only Works Once In Firefox?

    This is a strange one to me. I wrote a captcha script for my site which works fine. On the sign up page I put it on I have a JavaScript function that uses ajax to refresh the captcha without reloading the page. That works in all my browsers but Firefox and Opera. In these browsers you can click it once and it works, after that it doesn't refresh the image. When add an alert at the end of the function it shows that the function is firing, so it's acting like the page is caching, even though I'm sending it with POST. Does any one know why these two browsers are doing that and how to stop it? The code is: function loadXMLDoc(div){if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safarixmlhttp=new XMLHttpRequest();}else{// code for IE6, IE5xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}xmlhttp.onreadystatechange=function(){if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById(div).innerHTML=xmlhttp.responseText;}}}function refreshcaptcha (){loadXMLDoc("captcha") xmlhttp.open("POST","refreshcaptcha.php",true);xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');xmlhttp.send();}
×