<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>VBForums - jQuery</title>
		<link>http://www.vbforums.com/</link>
		<description>Discuss anything and everything about jQuery.</description>
		<language>en</language>
		<lastBuildDate>Sun, 19 May 2013 17:07:21 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.vbforums.com/images/misc/rss.png</url>
			<title>VBForums - jQuery</title>
			<link>http://www.vbforums.com/</link>
		</image>
		<item>
			<title>jQuery JSON validation for username before continuing with Facebook registration...</title>
			<link>http://www.vbforums.com/showthread.php?720757-jQuery-JSON-validation-for-username-before-continuing-with-Facebook-registration&amp;goto=newpost</link>
			<pubDate>Tue, 07 May 2013 04:13:56 GMT</pubDate>
			<description><![CDATA[OK, heres the thing...

I am integrating facebook login into my website...  Its all working, except i have yet to validate the fields on the registration form.

ie: all of the following work...
Facebook login,
facebook registration


the only problem being -> if  the username is taken on my server, the registration errors...
However, facebook thinks that the user is registered still... so it wont direct to the register page, but instead login, I set the cookie for the user (or attempt to) but validation says its not a valid user so wont accept the login... and it can become a big circle... etc

so i found out about the async validation...

and it seems to work ok... except it says my json return is causing a parse error...

my PHP webcode:

PHP:
---------

function CheckUsername($reqname){
	global $facebook, $clsUser, $dbi, $user_prefix, $prefix;
		
	$result = sql_query("SELECT user_id, facebook, email_address, password FROM ".$user_prefix
					."user_account WHERE username='".addslashes($reqname)."'",$dbi);	
	
	if(sql_num_rows($result,$dbi)>0){
		$data = "Taken";
		
	} else {
		$data = "Free";
		
	}
	header("Content-Type: application/json");
              // tried it with and without the [ square brackets...
	echo "[{\n";
	echo "\"username\": ".json_encode($data)."\n";
	echo "}]";
	exit;
}
---------
which outputs (as a download file... due to the content headers)


Code:
---------
{
"username": "Taken"
}
---------

the json request is:


Code:
---------
<script src="http://code.jquery.com/jquery-1.7.1.min.js" type="text/javascript"></script>
<script type="text/javascript"> 
function validate_async(form, cb) {
	
	console.log("We are in the validate_async box...");
	
	//if(form.username.length<3){
	//	console.log("the username length is less than 3 chars");
	//	cb("username: Username length must be longer than 3 chars.");
	
	//}else{	
	
			// TODO: check password is ok before proceeding...
			
			console.log("Fetching the username '"+form.username+"'");	
			
			$.getJSON('http://domain.com/member/fb_login.php?op=CheckUsername&username=' + form.username,
				function(response) {
					console.log( "first finish routine? ");		
				})
			.done(function(response) { 
				console.log( "second success ( .done() )" );
				
				console.log("We are checking the response...'"+response.username+"'");
				
				if (response.username == "Free") {
					// Username isn't taken, let the form submit
					//cb();
					
					console.log("error is true???");	
					
					//call back
					cb();
				}
				
				console.log("We are displaying username error...");
				cb({username: 'That username is taken, Sorry!'});
			
				 
			})
			.fail(function(response, textstatus, errorresult) { 
				console.log( "error ( .fail() ) response: " +response );
				console.log( "error ( .fail() ) textstatus: " +textstatus );
				console.log( "error ( .fail() ) errorresult: " +errorresult ); 
				cb({username: 'We failed to check the username...'});
				
			})
			.always(function(response) { 
				console.log( "complete ( .always() )" ); 
				
			});

	//}		
	console.log("exiting the validate_async");
}
</script> 

<div style="float:right;">
	<div class="fb-registration" data-fields='[
    				{"name":"name"},
                    {"name":"first_name"},
                    {"name":"last_name"},
                    {"name":"email"},
                    {"name":"location"},
                    {"name":"username","description":"Username for our website","type":"text"},
                    {"name":"password"},
                    {"name":"captcha"},
                    {"name":"newsletter","description":"Subscribe to our newsletter?","type":"checkbox"}
                    ]' 
        data-redirect-uri="<?php echo FB_SITEBASE; ?>/members/fb_login.php?op=do_register"
      width="300" onvalidate="validate_async">
    </div></div>
---------
the webpage itself works... - ive tried it using browser, and tested the output on a validator which says its ok...

but, the output on my console is: 


---Quote---

LOG: We are in the validate_async box... 
LOG: Fetching the username 'eee' 
LOG: exiting the validate_async 
LOG: error ( .fail() ) response: [object Object] 
LOG: error ( .fail() ) textstatus: parsererror 
LOG: error ( .fail() ) errorresult: [object Error] 
LOG: complete ( .always() ) 
LOG: We are in the validate_async box... 
LOG: Fetching the username 'eee' 
LOG: exiting the validate_async 
LOG: error ( .fail() ) response: [object Object] 
LOG: error ( .fail() ) textstatus: parsererror 
LOG: error ( .fail() ) errorresult: [object Error] 
LOG: complete ( .always() )
---End Quote---
anyone got any ideas?]]></description>
			<content:encoded><![CDATA[<div>OK, heres the thing...<br />
<br />
I am integrating facebook login into my website...  Its all working, except i have yet to validate the fields on the registration form.<br />
<br />
ie: all of the following work...<br />
Facebook login,<br />
facebook registration<br />
<br />
<br />
the only problem being -&gt; if  the username is taken on my server, the registration errors...<br />
However, facebook thinks that the user is registered still... so it wont direct to the register page, but instead login, I set the cookie for the user (or attempt to) but validation says its not a valid user so wont accept the login... and it can become a big circle... etc<br />
<br />
so i found out about the async validation...<br />
<br />
and it seems to work ok... except it says my json return is causing a parse error...<br />
<br />
my PHP webcode:<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB"><br /></span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">CheckUsername</span><span style="color: #007700">(</span><span style="color: #0000BB">$reqname</span><span style="color: #007700">){<br />&nbsp;&nbsp;&nbsp;&nbsp;global&nbsp;</span><span style="color: #0000BB">$facebook</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$clsUser</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$dbi</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$user_prefix</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$prefix</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">sql_query</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT&nbsp;user_id,&nbsp;facebook,&nbsp;email_address,&nbsp;password&nbsp;FROM&nbsp;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$user_prefix<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">.</span><span style="color: #DD0000">"user_account&nbsp;WHERE&nbsp;username='"</span><span style="color: #007700">.</span><span style="color: #0000BB">addslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$reqname</span><span style="color: #007700">).</span><span style="color: #DD0000">"'"</span><span style="color: #007700">,</span><span style="color: #0000BB">$dbi</span><span style="color: #007700">);&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">sql_num_rows</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">,</span><span style="color: #0000BB">$dbi</span><span style="color: #007700">)&gt;</span><span style="color: #0000BB">0</span><span style="color: #007700">){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"Taken"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"Free"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"Content-Type:&nbsp;application/json"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;tried&nbsp;it&nbsp;with&nbsp;and&nbsp;without&nbsp;the&nbsp;&#91;&nbsp;square&nbsp;brackets...<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"&#91;{\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"\"username\":&nbsp;"</span><span style="color: #007700">.</span><span style="color: #0000BB">json_encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$data</span><span style="color: #007700">).</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"}&#93;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;exit;<br />}&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code></code><hr />
</div>which outputs (as a download file... due to the content headers)<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">{<br />
&quot;username&quot;: &quot;Taken&quot;<br />
}</code><hr />
</div><br />
the json request is:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&lt;script src=&quot;http://code.jquery.com/jquery-1.7.1.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;<br />
&lt;script type=&quot;text/javascript&quot;&gt; <br />
function validate_async(form, cb) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; console.log(&quot;We are in the validate_async box...&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; //if(form.username.length&lt;3){<br />
&nbsp; &nbsp; &nbsp; &nbsp; //&nbsp; &nbsp; &nbsp; &nbsp; console.log(&quot;the username length is less than 3 chars&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; //&nbsp; &nbsp; &nbsp; &nbsp; cb(&quot;username: Username length must be longer than 3 chars.&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; //}else{&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // TODO: check password is ok before proceeding...<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(&quot;Fetching the username '&quot;+form.username+&quot;'&quot;);&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $.getJSON('http://domain.com/member/fb_login.php?op=CheckUsername&amp;username=' + form.username,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; function(response) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log( &quot;first finish routine? &quot;);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; })<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .done(function(response) { <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log( &quot;second success ( .done() )&quot; );<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(&quot;We are checking the response...'&quot;+response.username+&quot;'&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (response.username == &quot;Free&quot;) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Username isn't taken, let the form submit<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //cb();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(&quot;error is true???&quot;);&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //call back<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cb();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(&quot;We are displaying username error...&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cb({username: 'That username is taken, Sorry!'});<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; })<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .fail(function(response, textstatus, errorresult) { <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log( &quot;error ( .fail() ) response: &quot; +response );<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log( &quot;error ( .fail() ) textstatus: &quot; +textstatus );<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log( &quot;error ( .fail() ) errorresult: &quot; +errorresult ); <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cb({username: 'We failed to check the username...'});<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; })<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .always(function(response) { <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log( &quot;complete ( .always() )&quot; ); <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; //}&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; console.log(&quot;exiting the validate_async&quot;);<br />
}<br />
&lt;/script&gt; <br />
<br />
&lt;div style=&quot;float:right;&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;fb-registration&quot; data-fields='[<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&quot;name&quot;:&quot;name&quot;},<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&quot;name&quot;:&quot;first_name&quot;},<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&quot;name&quot;:&quot;last_name&quot;},<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&quot;name&quot;:&quot;email&quot;},<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&quot;name&quot;:&quot;location&quot;},<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&quot;name&quot;:&quot;username&quot;,&quot;description&quot;:&quot;Username for our website&quot;,&quot;type&quot;:&quot;text&quot;},<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&quot;name&quot;:&quot;password&quot;},<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&quot;name&quot;:&quot;captcha&quot;},<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&quot;name&quot;:&quot;newsletter&quot;,&quot;description&quot;:&quot;Subscribe to our newsletter?&quot;,&quot;type&quot;:&quot;checkbox&quot;}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]' <br />
&nbsp; &nbsp; &nbsp; &nbsp; data-redirect-uri=&quot;&lt;?php echo FB_SITEBASE; ?&gt;/members/fb_login.php?op=do_register&quot;<br />
&nbsp; &nbsp; &nbsp; width=&quot;300&quot; onvalidate=&quot;validate_async&quot;&gt;<br />
&nbsp; &nbsp; &lt;/div&gt;&lt;/div&gt;</code><hr />
</div>the webpage itself works... - ive tried it using browser, and tested the output on a validator which says its ok...<br />
<br />
but, the output on my console is: <br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Quote:</div>
	<div class="bbcode_quote printable">
		<hr />
		
			<br />
LOG: We are in the validate_async box... <br />
LOG: Fetching the username 'eee' <br />
LOG: exiting the validate_async <br />
LOG: error ( .fail() ) response: [object Object] <br />
LOG: error ( .fail() ) textstatus: parsererror <br />
LOG: error ( .fail() ) errorresult: [object Error] <br />
LOG: complete ( .always() ) <br />
LOG: We are in the validate_async box... <br />
LOG: Fetching the username 'eee' <br />
LOG: exiting the validate_async <br />
LOG: error ( .fail() ) response: [object Object] <br />
LOG: error ( .fail() ) textstatus: parsererror <br />
LOG: error ( .fail() ) errorresult: [object Error] <br />
LOG: complete ( .always() ) 
			
		<hr />
	</div>
</div>anyone got any ideas?</div>

]]></content:encoded>
			<category domain="http://www.vbforums.com/forumdisplay.php?94-jQuery">jQuery</category>
			<dc:creator>wpearsall</dc:creator>
			<guid isPermaLink="true">http://www.vbforums.com/showthread.php?720757-jQuery-JSON-validation-for-username-before-continuing-with-Facebook-registration</guid>
		</item>
		<item>
			<title>how to display image in html table uisng jquery</title>
			<link>http://www.vbforums.com/showthread.php?719651-how-to-display-image-in-html-table-uisng-jquery&amp;goto=newpost</link>
			<pubDate>Sun, 28 Apr 2013 03:51:27 GMT</pubDate>
			<description><![CDATA[i have following line of code along with gif image ..it showing all database driven data but not image 

any help 


Code:
---------
 for (var i = 0; i < data.d.length; i++) {
 
 $("#tbl").append("<tr  bgcolor= lightblue><td>" + (data.d[i].CustomerID) + "</td><td>" + (data.d[i].CompanyName) + "</td>" + "<td> <img  src=" +  "'" + "detail.gif" +"'" + "height=20 width=20>  </td>" +  "</tr>");
---------
]]></description>
			<content:encoded><![CDATA[<div>i have following line of code along with gif image ..it showing all database driven data but not image <br />
<br />
any help <br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"> for (var i = 0; i &lt; data.d.length; i++) {<br />
&nbsp;<br />
&nbsp;$(&quot;#tbl&quot;).append(&quot;&lt;tr&nbsp; bgcolor= lightblue&gt;&lt;td&gt;&quot; + (data.d[i].CustomerID) + &quot;&lt;/td&gt;&lt;td&gt;&quot; + (data.d[i].CompanyName) + &quot;&lt;/td&gt;&quot; + &quot;&lt;td&gt; &lt;img&nbsp; src=&quot; +&nbsp; &quot;'&quot; + &quot;detail.gif&quot; +&quot;'&quot; + &quot;height=20 width=20&gt;&nbsp; &lt;/td&gt;&quot; +&nbsp; &quot;&lt;/tr&gt;&quot;);</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://www.vbforums.com/forumdisplay.php?94-jQuery">jQuery</category>
			<dc:creator>ERUM</dc:creator>
			<guid isPermaLink="true">http://www.vbforums.com/showthread.php?719651-how-to-display-image-in-html-table-uisng-jquery</guid>
		</item>
		<item>
			<title>JQUery Must Not Affect Code Behind</title>
			<link>http://www.vbforums.com/showthread.php?719433-JQUery-Must-Not-Affect-Code-Behind&amp;goto=newpost</link>
			<pubDate>Fri, 26 Apr 2013 07:54:40 GMT</pubDate>
			<description><![CDATA[Hi guys I want to know if its possible to execute my code behind (VB code) even the jquery execute first.
To give you a more details on what I am saying, this is what i have


Code:
---------
$('#first_div').show();
$('#second_div').hide();

$('#button1').click(function() {
    $('#first_div').slidetoggle('slow');
    $('#second_div').hide();

    $(this).slideToggle('active');
    return false;
});
$('#button2').click(function() {
    $('#second_div').slidetoggle('slow');
    $('#first_div').hide();

    $(this).slideToggle('active');
    return false;
});
---------
with those code my code behind (VB code) doesn't execute anymore. If turn it into return true it will execute however the jquery will not work.

Please help me understand this JQuery :). Thank you]]></description>
			<content:encoded><![CDATA[<div>Hi guys I want to know if its possible to execute my code behind (VB code) even the jquery execute first.<br />
To give you a more details on what I am saying, this is what i have<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">$('#first_div').show();<br />
$('#second_div').hide();<br />
<br />
$('#button1').click(function() {<br />
&nbsp; &nbsp; $('#first_div').slidetoggle('slow');<br />
&nbsp; &nbsp; $('#second_div').hide();<br />
<br />
&nbsp; &nbsp; $(this).slideToggle('active');<br />
&nbsp; &nbsp; return false;<br />
});<br />
$('#button2').click(function() {<br />
&nbsp; &nbsp; $('#second_div').slidetoggle('slow');<br />
&nbsp; &nbsp; $('#first_div').hide();<br />
<br />
&nbsp; &nbsp; $(this).slideToggle('active');<br />
&nbsp; &nbsp; return false;<br />
});</code><hr />
</div>with those code my code behind (VB code) doesn't execute anymore. If turn it into return true it will execute however the jquery will not work.<br />
<br />
Please help me understand this JQuery :). Thank you</div>

]]></content:encoded>
			<category domain="http://www.vbforums.com/forumdisplay.php?94-jQuery">jQuery</category>
			<dc:creator>aNubies</dc:creator>
			<guid isPermaLink="true">http://www.vbforums.com/showthread.php?719433-JQUery-Must-Not-Affect-Code-Behind</guid>
		</item>
	</channel>
</rss>
