I have an ajax call in jQuery which returns a set of values: p1, p2 … pn. These contain strings of a path and filename for displaying images. ie the img src value.
I want to loop through these n values ( i = 1 to n ) something like [pseudo] :
$("#photo_" + i).html( '<img src="' + data.p + i + '">' );
The selector works fine .. it’s the img src I am having problems building.
You need to change
data.p + itodata["p" + i]Change
To