Hi All,
this is my client code,
this is my server side code,
here i have if condition to check the weather forecast and its working but i also wanted to add image @ specific location that means in input box but the document.write opens a new page. please somebody help me how to add image in javascript based on if condition without navigating the page to locate the image in input box of server side
this is my client code,
Code:
<li> <label for="city"><span class="required">City/State</span></label> <input id="city" name="city" type="text" class="text required" disabled="disabled"> </li>
Code:
function handler(evtXHR) { if(xhr.readyState == 4) { if(xhr.status == 200) { var response = xhr.responseXML; //var response = xhr.responseText; console.log(response); toggleDiv("page"); toggleDiv("pageDtl"); $("input#city").val(response.getElementsByTagName("city").item(0).firstChild.data); var desc = response.getElementsByTagName("desc").item(0).firstChild?response.getElementsByTagName("desc").item(0).firstChild.data : ""; if(desc == "Cloudy") { alert("cloudy"); $("input#desc").val(response.getElementsByTagName("desc").item(0).firstChild?response.getElementsByTagName("desc").item(0).firstChild.data :); document.write("<img src='images/sunny.gif'>");
Comment