Results 1 to 5 of 5

Thread: well is any way change TwitterId (with or without reload)???

  1. #1
    Join Date
    Jan 2012
    Posts
    74
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default well is any way change TwitterId (with or without reload)???

    HTML Code:
     <script src="https://api.twitter.com/1/statuses/user_timeline/twitterID.json?callback=updateTweets"></script>
    I AM USING THIS TO THE END of the html page for my callback updateTweets retreive lastest tweets... well is any way change TwitterId (with or without reload)???

  2. #2
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    You could change the src with javascript:
    Change the script tag to:
    HTML Code:
    <script src="https://api.twitter.com/1/statuses/user_timeline/twitterID.json?callback=updateTweets" id="tweetsId"></script>
    And you can play around with javascript like this:
    Code:
    var twitterId = document.getElementById('twitterId');
    twitterId.src = "https://api.twitter.com/1/statuses/user_timeline/twitterID.json?callback=something completely different";
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

  3. #3
    Join Date
    Jan 2012
    Posts
    74
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default

    twitterId.src << this what do? please see callback below...

    upon browser see last line on html page I mean the LAST LINE BELOW
    HTML Code:
    <input type="text" list="tweets" id="tweets1" >
    </input>
    ...
    ...
    ...
    <script src="https://api.twitter.com/1/statuses/user_timeline/twitterID.json?callback=updateTweets" id="tweetsId"></script>
    POPULATES THE COMBO HTML5 BOX...

    This I want to change is "..twitterID.json..." in
    HTML Code:
    <script src="https://api.twitter.com/1/statuses/user_timeline/twitterID.json?callback=updateTweets" id="tweetsId"></script>
    with real twitterID, well?



    Code:
    function updateTweets(tweets) {
    	//var tweetsSelection = document.getElementById("tweets");
    		
    		
    		var tweetsSelection = document.createElement("datalist");
    		tweetsSelection.setAttribute("id", "tweets");
    		
    	// add all tweets to the tweets menu
    	for (var i = 0; i < tweets.length; i++) {
    		tweet = tweets[i];
    
    		// create option
    		var option = document.createElement("option");
    		option.text = tweet.text;
    
    		// strip any quotes out of the tweet so they don't mess up our option
    		option.value = tweet.text.replace("\"", "'");
    		
    
    		// add option to select
    		tweetsSelection.appendChild(option);
        }
    
    	document.getElementById("tweets1").appendChild(tweetsSelection);
    }

  4. #4
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    with this"
    Code:
    twitterId.src
    can be used to change the src, or in your case the Twitterid.json.
    Code:
    twitterId.src = "https://api.twitter.com/1/statuses/user_timeline/somethingElse";
    Will change:
    Code:
    <script src="https://api.twitter.com/1/statuses/user_timeline/twitterID.json?callback=updateTweets" id="tweetsId"></script>
    to:
    Code:
    <script src="https://api.twitter.com/1/statuses/user_timeline/somethingElse" id="tweetsId"></script>
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

  5. #5
    Join Date
    Jan 2012
    Posts
    74
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default

    is any way change tweets (twitterID) without refresh of page?

Similar Threads

  1. Replies: 0
    Last Post: 01-10-2012, 05:27 PM
  2. tab content - reload
    By radujit in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 01-21-2011, 04:33 AM
  3. DOM Reload?
    By Beagle72 in forum JavaScript
    Replies: 13
    Last Post: 07-08-2010, 05:05 AM
  4. "Reload" the script after having dynamically change its content
    By f4nch in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 05-06-2010, 10:26 PM
  5. text change without reload
    By headznet in forum JavaScript
    Replies: 1
    Last Post: 02-23-2005, 05:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •