(please don't refresh or leave the page, this shouldn't take long)
(please don't refresh or leave the page, this shouldn't take long)
1000+
Reviews!
1000+
Reviews!
SEARCH SITE
Favorites
Cart
SEARCH
1000+
Reviews!
Click To Call Us Now!
SEARCH
Favorites
Cart
SAVE THE DATES
WEDDING INVITATIONS
THANK YOU CARDS
EXTRAS
MAKE DEPOSIT
BLOG
MY CART
MY ACCOUNT
CONTACT US
Our Design Process
After receiving your order, our designers will create a digital proof based on the information you provide us within two business days. We will NOT print your order until you have received a digital proof and have given us your approval. You will have the chance to make changes to your design. You also have the option to see a printed proof before you have approved your order. There is a charge to print and mail these proofs. PLEASE NOTE that if you forego seeing a printed proof of your order all guarantees of reprints due to the way colors or pictures are printed will be voided and you will take full responsibility for any reprint costs. Final payment is due when you approve to print. Before doing so you will need to use the checklist provided with each proof to make sure there are no errors. We will not be responsible for any errors that have been approved. If you have additional questions, please contact us today.
X
Forgot Your Password?
Please enter your email below. You will receive a link to a create a new password via email.
Reset Password
X
close this message
Parent ID is 768 and parent title is Info Dump Back to Info Dump Index
SEE THE CONSOLE FOR RESULTS OF THE TESTS BELOW
Test 1: Pass a PHP indexed array directly to a JS variable... it says that variable is an array type (with no data)
Test 2: Pass a PHP indexed array wrapped in quotes to a JS variable... it says that variable is the string "Array"
Test 3: Pass a json_encoded PHP indexed array to a JS variable, NOT wrapped in quotes... you get a JS array
Test 4: Pass a json_encoded PHP indexed array wrapped in quotes to a JS variable... you get a string in JSON format... ["Value 1", "Value 2", etc.]
Test 5: Pass a PHP indexed array (not json_encoded) and parse it on the JS side NOT wrapped in quotes before assigning it to a JS variable... you get an ERROR
Test 6: Pass a PHP indexed array (not json_encoded) and parse it on the JS side AFTER wrapping it in quotes and assigning it to a JS variable... you get an ERROR (it tries to parse 'A')
Test 7: Pass a json_encoded PHP indexed array and parse it on the JS side NOT wrapped in quotes before assigning it to a JS variable... you get an ERROR
Test 8: Pass a json_encoded PHP indexed array and parse it on the JS side AFTER wrapping it in quotes and assigning it to a JS variable... you get a JS array (same as test 3, but more complicated)
SWITCH GEARS FROM RECEIVING A SIMPLE INDEXED ARRAY TO RECEIVING A JSON STRING FORMATTED AS AN INDEXED ARRAY OF ASSOCIATIVE ARRAYS
(I'm talking formatted with [ ] to represent the outer indexed array and { } for each inner associative array... [{A:1, B:2, C:3},{D:4, E:5, F:6}, etc.])
Test 9: Don't parse it, you simply get a long string in JSON format
Test 10: Parse the incoming string and you get an indexed array of associative arrays (well, objects since JS doesn't have associative arrays)
Bottom Line:
(1) If it's an array, encode it before you pass from PHP to JS
(2) If it doesn't encode to [{},{},{}] format then format it correctly before you pass it from PHP to JS
(3) If it's an indexed array you don't need to parse it in JS
(4) If it's an associative array or something fancier (like an indexed array of associative arrays), you DO need to parse it in JS
(5) Don't try to parse something that's not a string, wrap it in quotes (unless it's an indexed array)
(6) If you wrap an incoming indexed array in quotes it will rended as a string in JSON format. You can parse it, OR just remember bottom line #1