A Wetpaint Site
|
TV Fandex 100
Sign in to Wetpaint
Internet Explorer 6.0 is not supported. Please try
IE 8
or
Firefox
.
Home
Discussions
Photos
Videos
News
Updates
Droplets
Members
Sign in
or
Single Quotes, JavaScript, and Event Handlers
Page Versions
Key:
additions
deletions
Please select two page versions to compare - check the checkbox to the right of each version.
Showing 7 pages
Date/Time
Made By
Edit Note
Type
Scope
Compare
May 16 2008, 9:36 PM EDT
elaine2
Rename
rename
No content added or deleted.
Change:
Renamed from JavaScript in Event Handlers by
elaine2
May 16 2008, 9:36 PM EDT for: Rename
May 16 2008, 9:35 PM EDT
elaine2
edit
242 words added
127 words deleted
Change:
Render a single quote hex reference. URL encoding will convert single quotes to hex references, but an additional JavaScript call will be necessary to decode the string before passing it to the listener.
<a href="#addPage" onclick="
WPCAPI.showAddPageDialog(
decodeURIComponent(
decodeURIComponent('foo
'bob
'
%27
sPage'
)
sbar')
,
decodeURIComponent('The Official
decodeURIComponent(
'Bob
View changes from previous version.
(Word count: 266)
May 16 2008, 8:41 PM EDT
elaine2
edit
2 words added
Change:
errors in
Internet Explorer 6 and 7 as that code is interpreted. Unfortunately this is a problem common across all web user interface development.The solution is to render any arguments at risk for having single quotes
View changes from previous version.
(Word count: 164)
May 16 2008, 8:22 PM EDT
elaine2
edit
21 words added
35 words deleted
Change:
Incorrect
correct
rendered
usage:
code:
// $cellId is "thisIs'AQuote",ForSure"
//$displayName is "this is 'a quote', for sure"
$result .= '<a
<a
href="#addPage" onclick="WPCAPI.showAddPageDialog(
decodeURIComponent('foo
'
sbar')
decodeURIComponent(\'' . urlencode($cellId) .
,
'\')
,
decodeURIComponent('The
decodeURIComponent(\'' . urlencode($displayName) .
Official
'\')
Foo
);
'
">';
s Bar Page'));">
Incorrect usage:
View changes from previous version.
(Word count: 162)
May 16 2008, 8:20 PM EDT
elaine2
edit
34 words added
Change:
Render an "Add Page" link for a cell with the following attributes:
cellId
: foo'sbar
cellDisplayName
: The Official Foo's Bar Page
Correct rendered code:
<a href="#addPage" onclick="
WPCAPI.showAddPageDialog(
decodeURIComponent('foo%27sbar')
,
decodeURIComponent('The%20Official%20Foo%27s%20Bar%20Page'));">
Example
correct usage:// $cellId is "thisIs'AQuote",ForSure"//$displayName is "this is 'a quote', for sure"$result .=
View changes from previous version.
(Word count: 170)
May 16 2008, 7:57 PM EDT
elaine2
edit
133 words added
Change:
The solution is to render any arguments at risk for having single quotes as URL encoded. Then, to avoid encoding mismatches with Wetpaint's JavaScript application, wrap the encoded string in JavaScript's
decodeURIComponent
method so it will be unencoded when passed to the listener.
Example correct usage:
// $cellId is "thisIs'AQuote",ForSure"
View changes from previous version.
(Word count: 127)
May 16 2008, 7:29 PM EDT
elaine2
create
No content added or deleted.
Change:
Created by
elaine2
May 16 2008, 7:29 PM EDT for: no reason given
JavaScript must be enabled in order for you to contribute to this site.
To start contributing, enable JavaScript by changing your browser options, then
try again
.
Home
Injected Technical Overview
Developer's Guide
Quick Start Guide
Hello World Tutorial
Integration Guide
Wetpaint Injected Best Practices Guide
Sample Applications
User-Generated Content Styles
Client Application
Function Overriding
Single Quotes, JavaScript, and Event Handlers
SEO Recommendations
Test Paths
API Reference
Release Schedule
Bugs & Issues
FAQ
Contact Us
Events & Camps
new page
(Uncategorized)