Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
Map the image path in jquery
Gnanavel Sekar
Mar 3 2017 2:44 AM
228
Reply
Hi pal,
I have more than one project in one solution, am just displaying the image from folder but that folder exist in another project but in same solution.
Just assume i have one project called
Themes and another one orchard.web
this below script exists in themes project and image exists in orchard.web project..
the themes project is common for all layout that's why am here using. the images all exist under
~/UploadFiles/ folder.
$.ajax({
url: crudServiceBaseUrl,
data: { UserId: UD },
type: "Get",
dataType: 'json',
contentType: 'application/json; charset=utf-8',
success: function (result) {
if (result.ContactImg != null) {
----->here i want to assign the image to that image control
$(".Imgchange").attr('src', '
~/UploadFiles/
' + result.ContactImg.split('.')[0] + "_" + UD + result.ContactImg.split('.')[1]);
}
else {
$(".Imgchange").attr('src', '/OrchardLocal/Themes/Gentelella/Content/Images/img.jpg');
---->it's working fine due to in same project as well as it's static
}
}
});
Thanks in advance
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
End Date must be greater than Start date using jquery
How to check if TextBox control has value in JQuery