I see that there is toSource in Firefox. I'm wondering if there is
anything equivalent in devtools that can print the source code of an
object. Thanks!
http://spacebug.com/javascript-object-to-string/
--
Regards,
Peng
Hi Sam,
Some people mentioned this https://github.com/douglascrockford/JSON-js
But I guess, chrome already has JSON.stringify() implement. Sourcing
the above script is unnecessary and will cause problem? The following
code does not print the JSON string. I guess this is because of this
conflict?
<html>
<body>
<script type="text/javascript"
src="http://cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js"><script/>
<script>
var obj={x:1, y:2};
var json_data = JSON.stringify(obj);
document.write('xx' + json_data + '<br/>');
</script>
</body>
</html>
--
Regards,
Peng
I would like to add DevTools-like treeview of object properties and methods on a web page. User is entering some script, which is interpreted. It's even possible that it generates functions. I certainly need something like toSource from Firefox. I've already downloaded the DevTools section of Blink, but there're a lot of sources, and it's hard to make myself run that "inspector inception" thing without certainity that it doesn't depend on extention-only API.
понедельник, 9 января 2012 г., 17:45:31 UTC+2 пользователь Peng Yu написал:Hi,I see that there is toSource in Firefox. I'm wondering if there is
anything equivalent in devtools that can print the source code of an
object. Thanks!http://spacebug.com/javascript-object-to-string/
--
Regards,
Peng
--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/a65c0a6d-e1eb-4723-9e8f-664f0b4b06c4%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.