Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript Hex Escaped String returned to Cocoa App without Escaped Characters
    primarykey
    data
    text
    <p>Part of an iPhone application that I'm developing is using a <em>UIWebView</em> to get the <em>onclick</em> event for certain elements on a page. One issue which has cropped up is on certain pages, like the iPhone version of <a href="http://news.google.com" rel="nofollow">http://news.google.com</a>, the page has already hex escaped the links like in the following:</p> <pre><code>javascript:window.open('/news/url?sa\x3dt\x26ct3\x3dMAA4CEgAUABgAWoCdXN6AWjYAQE\x26usg\x3dAFQjCNGUV1AFw0LsmkcQzNnvo69ma_dhhA\x26rt\x3dHOMEPAGE\x26url\x3dhttp://www.cnn.com/2010/US/11/30/wikileaks/?hpt%3DSbin');void(0); </code></pre> <p>When I receive the function from the <em>UIWebView</em> using the following method:</p> <pre><code>[webView stringByEvaluatingJavaScriptFromString: [NSString stringWithFormat:@"SomeFunction(%i,%i);",(NSInteger)pt.x,(NSInteger)pt.y]] </code></pre> <p>I receive back a String with the escaped characters in it as actual characters. So I receive back from the above method the javascript call with the hex escapes instead of:</p> <pre><code>javascript:window.open('/news/url?sa=t&amp;ct3=MAA4CEgAUABgAWoCdXN6AWjYAQE&amp;usg=AFQjCNGUV1AFw0LsmkcQzNnvo69ma_dhhA&amp;rt=HOMEPAGE&amp;url=http://www.cnn.com/2010/US/11/30/wikileaks/?hpt%3DSbin');void(0); </code></pre> <p>I have tried all sorts of methods of escaping the String in Javascript like percent escaping and URIEncoding/URIDecoding but it does not seem to work, just keeps sending the escaped string instead of the actual characters.</p> <p>Any help would be appreciated!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload