Skip to content

Instantly share code, notes, and snippets.

dorianroy / gist:4168816
Created Nov 29, 2012
Parse URL parameter String from Dictionary
View gist:4168816
// create parameter string from parameter dictionary
__block NSMutableString *parameterString;
[parameters enumerateKeysAndObjectsUsingBlock:^(id key, id value, BOOL *stop) {
if (!parameterString) parameterString = [NSMutableString stringWithString:@"?"];
else [parameterString appendString:@"&"];
// escape value string
NSString *escapedString = (__bridge NSString*)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)[parameters valueForKey:key], NULL, CFSTR(":/?#[]@!$&’()*+,;="), kCFStringEncodingUTF8);
[parameterString appendFormat:@"%@=%@", key, escapedString];
View A friendly like button
<link rel="stylesheet" href="" type="text/css" />
<script type="text/javascript">
function insertLikeButton() {
var container = document.getElementById('flbCont');
var w =;
var h =;
fbFrame = document.createElement("IFRAME");
fbFrame.setAttribute("src", fbURL);
fbFrame.setAttribute("scrolling", "no");