WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #24907, comment 1


Ignore:
Timestamp:
08/25/2013 06:31:36 PM (8 years ago)
Author:
c3mdigital
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24907, comment 1

    initial v1  
    11I think we should be json encoding PHP string variables when outputting to javascript.  This eliminates the need for escaping and surrounding with quotes.
     2
     3Results of json_encode patch on output in header:
     4
     5
     6{{{
     7var ajaxurl = "\/wp-admin\/admin-ajax.php",
     8        pagenow = "edit-post",
     9        typenow = "post",
     10        adminpage = "edit-php",
     11        thousandsSeparator = ",",
     12        decimalPoint = ".",
     13        isRtl = 0;
     14}}}