hi
i am using ajax to retrieve the img url path how am i going to use the img url path i retrieve and display as a image and i using javascript language
anyone know?
if can show me example of how to do that
i try the follow way but don’t work what wrong?
var descIg = "";
descIg += rssent[i].descImg;
var placeImg = document.createElement('img');
placeImg.src = descIg;
With “placeImg” it will only be that text string that is added as content. You should use placeImg without the quotes to use the image that you created.
You may have to ask at other placed for dojo-specific info though. There are some dojo forums that can be of more help with dojo-related issues.
okay can i ask you regarding ajax
how am i going to call the title
because normally if you call start year is like
var detail = eval…
then for loop it
inside should be
var start year=“”
startyear += …[i].startyear
something like this but how am i going to call the title inside the images?
the how to call the title?
cause when i call the title i try this
var detail = eval…
then for loop it
inside should be
var title=“”
startyear += …[i].image.images.title
but it give me error of is null or not an object
mygetrequests.onreadystatechange = function() {
if (mygetrequests.readyState == 4) {
if (mygetrequests.status == 200 || window.location.href.indexOf("href") == -1) {
var detail = dojo.fromJson("(" + mygetrequests.responseText + ")");
var rssent = detail.infos.info;
for (var i = 0; i < rssent.length; i++) {
var title = "";
title += rssent[i].image.images.title
document.getElementById("txtHint").innerHTML = title // the txtHint is div created
okay , then ? i want to go from the to the title? so how shld i write i know you say indented code is impt…this is hw it look lk the json? cause i gt the var detail = eval(…reponseText)…then i want to get to the title, so i write this detail.infos.info.image.images.title …is this the indenting ?but i got a error which is null or not a object
what you mean by how that obj contain a array
can just tell me why i got this error ? and how should i solve it?
You are getting the error because images contains an array, but you are trying to instead access a property of images called title.
Because it is an array, no property called title exists.
What you need to do instead is to access one of the three array indexes, each of which contains (among other properties) the title property.