Hi all,

this may not be a good codes but maybe a quick and dirty solution for
those who met with the same problem like me.

I am developing a photo section in my web app using jquery BUT I have
a problem when trying to use the Ajax load() function to pass the new
Photo Title to a my php file for processing.

For example, when I use the
document.getElementById('photo_title').value which is actually to get
the wordings "Photo Title", BUT the load() function only pass the
"Photo" and those after empty space will be dropped :(

So I add the str.replace() to fix the empty spaces issue.

Here is my function

function photo_title_change(pid)
{
        var photo_title = document.getElementById('photo_title').value;
        photo_title = photo_title.replace(/\s/g,"%20");
        alert(photo_title); // this is for instant check of the variable
which can be disable

$('div#phototitle').load("request.php?a=photo_title_change&pid=" + pid
+ "&title=" + photo_title);
}

Cheers

Boyd Chung

Reply via email to