0

I have next code block:

$.post('page.php', function(data)
{
    //data - full page info
});

Returned data is html markup. And in this html i have javascript section with array:

var someArray= new Array();

How can i get this array object from data object?

Edit:

I cannot change data which returned from page.php. And basically this javascript just plugin to change existing page UI from other website. So i know that page contains array and i need get data from it.

1 Answer 1

2

It will work fine just append it to the body, then read in the variable.

See below:

http://jsfiddle.net/6CJUy/

Sign up to request clarification or add additional context in comments.

7 Comments

I will read this page few times with different params. So i cannot every time just append it? Or i need to have some namespaces or what?
ok ... have a div #holder ... and then just run $('#holder').html(RESPONSE) .... and then read the value ..
What you mean read? How can i access it in javascript when i added this to holder?
$('#holder').html() or $('#holder').innerHTML
Dear Evgeny .. try it see what happens
|

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.