sandy1028 Posted July 10, 2014 Share Posted July 10, 2014 var content = "javascript:(function() {document.open();document.write("<script>abc = '37418';adt = '484';h = '585';w = '111';nel = '12482,100';test = 'on';num = '1';</script><script type='text/javascript' src='http://abc.js'></script>");document.close();})()"; abc = '37418'; adt = '484'; Can you please help in extracting the key and value pairs in the string and print the value of particular value for the key. Please help Quote Link to comment https://forums.phpfreaks.com/topic/289670-key-value-pairing-from-string/ Share on other sites More sharing options...
requinix Posted July 10, 2014 Share Posted July 10, 2014 In Javascript? Execute the code and you'll have those variables available to use. Or maybe I'm not sure what you're asking for. Quote Link to comment https://forums.phpfreaks.com/topic/289670-key-value-pairing-from-string/#findComment-1484582 Share on other sites More sharing options...
Maq Posted July 10, 2014 Share Posted July 10, 2014 I have no clue what you are asking, please elaborate. Quote Link to comment https://forums.phpfreaks.com/topic/289670-key-value-pairing-from-string/#findComment-1484601 Share on other sites More sharing options...
sandy1028 Posted July 11, 2014 Author Share Posted July 11, 2014 var content = "javascript:(function() {document.open();document.write("<script>abc = '37418';adt = '484';h = '585';w = '111';nel = '12482,100';test = 'on';num = '1';</script><script type='text/javascript' src='http://abc.js'></script>");document.close();})()"; In the variable "content", I want to get the all the values which has aaa = 'xyx' ,etc. When called using a['aaa'] then output should give the proper result as "xyx". Quote Link to comment https://forums.phpfreaks.com/topic/289670-key-value-pairing-from-string/#findComment-1484643 Share on other sites More sharing options...
requinix Posted July 11, 2014 Share Posted July 11, 2014 Again: is this in Javascript? The most straightforward method would be to enumerate all the properties of window before and after that code is executed, then determine what got added. Quote Link to comment https://forums.phpfreaks.com/topic/289670-key-value-pairing-from-string/#findComment-1484646 Share on other sites More sharing options...
sandy1028 Posted July 11, 2014 Author Share Posted July 11, 2014 yes javascript. Quote Link to comment https://forums.phpfreaks.com/topic/289670-key-value-pairing-from-string/#findComment-1484662 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.