0

i need to pass image paths to jquery from asp.net using hidden field
i want to serialize paths like "www.asd.com/asd.png ||| www.asd.com/asd2.png"

and reach them in jquery like

var pathStrings;

var blabla = pathStrings[i];

how can i do that?

thank you.

3
  • You are setting these values in a delimited hidden field and want to access them in javascript array? Commented Mar 29, 2013 at 14:52
  • Those image paths come from your database? Or do you set the client side? Commented Mar 29, 2013 at 14:53
  • the paths come from database and i want to reach them in javascript array Commented Mar 29, 2013 at 15:22

1 Answer 1

1

It sounds like this is what you're looking for

var hiddenFieldVal = $('#HiddenFieldID').val();
var pathStrings = hiddenFieldVal.split(' ||| ');
var blabla = pathStrings[i];
Sign up to request clarification or add additional context in comments.

1 Comment

this does looks like what i am looking for.I will try this out now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.