note 110908 added to faq.html
| From: | asok1111 at gmail dot com | Date: | Fri, 21 Dec 2012 11:22:13 +0000 |
| Subject: | note 110908 added to faq.html | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-192632@lists.php.net to get a copy of this message | ||
There is another method to pass data between php and javascript and this can be done by creating
javascript objects. After creating objects we can initialize and use properties of that object.
ex.
echo "<script type='text/javascript'>myOBJ['id[" .
$productsname['product_id']. "]']='-1';</script>";
here we have initialized the property id['someid'] , which is unknown property name now,
at run time of the object myOBJ which can be created as myOBJ =new Object() or using literal
notation myOBJ ={}. Please note that this initialize object can be compared with another value using
for in loop in javascript.
----
Server IP: 69.147.83.199
Probable Submitter: 111.91.118.67
----
Manual Page -- http://php.net/manual/en/faq.html.php
Edit -- https://master.php.net/note/edit/110908
Del: integrated -- https://master.php.net/note/delete/110908/integrated
Del: useless -- https://master.php.net/note/delete/110908/useless
Del: bad code -- https://master.php.net/note/delete/110908/bad+code
Del: spam -- https://master.php.net/note/delete/110908/spam
Del: non-english -- https://master.php.net/note/delete/110908/non-english
Del: in docs -- https://master.php.net/note/delete/110908/in+docs
Del: other reasons-- https://master.php.net/note/delete/110908
Reject -- https://master.php.net/note/reject/110908
Search -- https://master.php.net/manage/user-notes.php