| | |
jQuery and Authentication
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2008
Posts: 20
Reputation:
Solved Threads: 0
I am trying to create a web-based Twitter app that will print out a friend's timeline, but the Twitter API asks for username/password. How do I do the username/password authentication on the server-side without asking this from the user. Does anyone know how to do this? Is there also a way to create a dynamic app that will update inside the web page whenever a new twitter update occurs?
Here is the code:
Here is the code:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
$(document).ready(function(){ $('#response').createAppend('img', { src: 'images/twitter-32x32.png', alt: 'Loading...', id: 'loading_image'}, null); $.getJSON(url, ws_results); }); function ws_results(obj) { // hide the loading image $('#loading_image').hide("slow"); // alternative way of displaying properties // var property, propCollection = ""; // for (property in obj[0].user) { // propCollection += property + "\n"; // } // alert(propCollection); $('#response').createAppend( 'table', { width: '600px', align:'center', border:'2', rules:'none', frame:'box', style: 'background:#FFF;' , Name: 'tableData', id: 'Tweets' }, [ 'tr', { }, [ 'th', { colspan: '2', align: 'left', style: 'background: #FFF; color: #000 ' }, [ 'img', { src: 'images/twitter-logo.jpg', align: 'left'} ] ] ] ); // loop through items for (var i = 0; i < obj.length; i++) { // create table row $('#Tweets').append('<tr id="row' + i + '"><\/tr>'); $('#row' + i).append('<td align="left" id="lcell' + i + '" style="font-size: 10pt;"><\/td>'); $('#row' + i).append('<td align="left" id="rcell' + i + '" style="font-size: 10pt;"><\/td>'); if (typeof(obj[i].user.url) == "undefined" || obj[i].user.url == '') { $('#lcell' + i).createAppend('img', { src: obj[i].user.profile_image_url, Name: 'ProfileImg', align: 'left', hspace: '5', alt: obj[i].user.name }, null); } else { $('#lcell' + i).createAppend('a', { href: obj[i].user.url }, [ 'img', { src: obj[i].user.profile_image_url, Name: 'ProfileImg', align: 'left', hspace: '5', alt: obj[i].user.name }, null]); } $('#rcell' + i).createAppend('a', { id: 'Twit', title: obj[i].user.name, href: 'http://twitter.com/' + obj[i].user.screen_name }, obj[i].user.screen_name ); $('#rcell' + i).append(' ' + obj[i].text + ' '); $('#rcell' + i).append('<span id="created_at">' + obj[i].created_at + '<\/span>'); $('#rcell' + i).append(' from ' + obj[i].source); } } //]]> </script>
I don't want to ignore you but I don't know the answer either.
If you know ASP, you can save other daniweb members from idiots like me by helping out in this forum.
Visit this thread if your username starts with one of the following letters: B D F H J L N P R T X Y Z.
Visit this thread if your username starts with one of the following letters: B D F H J L N P R T X Y Z.
![]() |
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: frames not working in firefox
- Next Thread: Anaa framework problem
| Thread Tools | Search this Thread |
ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate automatically beta box browser bug calendar captchaformproblem checkbox child class close column createrange() css cursor date debugger dependent disablefirebug dom download dropdown editor element embed engine error events explorer ext file form forms getselection google gwt gxt hiddenvalue highlightedword hint html htmlform ie7 ie8 iframe images internet java javascript javascripthelp2020 jawascriptruntimeerror jquery jsf jsfile jump libcurl math media microsoft mimic object onmouseoutdivproblem onreadystatechange parent paypal pdf php player position post problem programming progressbar regex runtime scroll search security select shopping size software sql text textarea unicode w3c web website window windowofwords windowsxp wysiwyg \n





