r72754 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72753‎ | r72754 | r72755 >
Date:20:49, 10 September 2010
Author:kaldari
Status:reverted (Comments)
Tags:
Comment:
adding var declaration for banner list json
Modified paths:
  • /trunk/extensions/CentralNotice/SpecialBannerListLoader.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/SpecialBannerListLoader.php
@@ -89,7 +89,7 @@
9090 $templates = CentralNotice::selectNoticeTemplates( $this->project, $this->language );
9191 }
9292
93 - return json_encode( $templates );
 93+ return 'Banners = ' . json_encode( $templates );
9494 }
9595
9696 }

Comments

#Comment by Catrope (talk | contribs)   16:05, 14 September 2010

You're supposed to do this with a callback. You'd add a callback=? parameter (with a literal question mark) to the URL, which jQuery will convert to callback=_4d3f2a or whatever, and the server would then output _4d3f2a( your JSON here ).

#Comment by Catrope (talk | contribs)   19:11, 14 September 2010

Unless, of course, you're not doing this with AJAX but with a <script> tag... how is this being used anyway?

#Comment by Catrope (talk | contribs)   17:18, 27 September 2010

Reverted in r73137.

Status & tagging log