Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4014048
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:26:53+00:00 2026-05-20T09:26:53+00:00

<script src=http://widgets.twimg.com/j/2/widget.js></script> <script> var usr = ‘charliesheen’; function changeusr() { usr = document.getElementById(usrText).value; updatetwitter();

  • 0
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
   var usr = 'charliesheen';

   function changeusr()
   {
      usr = document.getElementById("usrText").value;
      updatetwitter();
   }

   var twitter;
   newtwitter();

   function updatetwitter()
   {
      twitter.render().setUser(usr).start();
   }

   function newtwitter()
   {
     twitter =
     new TWTR.Widget({
       version: 2,
       type: 'profile',
       rpp: 4,
       interval: 6000,
       width: 200,
       height: 300,
       theme: {
         shell: {
         background: '#ffffff',
         color: '#367542'
       },
       tweets: {
          background: '#e3dfe3',
          color: '#000000',
          links: '#110af5'
       }
     },
     features: {
        scrollbar: false,
        loop: false,
        live: false,
        hashtags: true,
        timestamp: true,
        avatars: false,
        behavior: 'all'
      }
    }).render().setUser(usr).start();
}
</script>
<br/>
Change user:
<input name="usrText"/>
<button onclick="changeusr()">Go</button>

The results I see are: It loads fine. When I enter a new username and click “go” it may or may not reload the twitter widget, and the link “join the conversation” points to the correct url. I’d like it to reload the url with the new user entered. I’m a complete javascript noob. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:26:53+00:00Added an answer on May 20, 2026 at 9:26 am

    Your input needs an id:

    <input id='usrText' name="usrText"/>
    

    Internet Explorer will return elements by name from “getElementById()”, but that is simply legacy broken behavior and it’s not imitated by other browsers.

    edit — an update:

    There doesn’t appear to be much documentation for that widget thing. Things work somewhat better if you set the “live” feature to true. Also, when you update the user, you have to zap an internal variable on the widget:

    function updatetwitter()
    {
      twitter._profileImage = null;
      twitter.setUser(usr).render().start();
    }
    

    Here is the jsfiddle if you’d like to see it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made this bookmarklet: javascript:(function(){var s=document.createElement('script');s.setAttribute('src','http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js');document.getElementsByTagName('body')[0].appendChild(s);$('#hldIntMain').hide();$('#fadeBackground').hide();return false;})() Formatted code: // Add in jQuery var
var script = document.createElement( 'script' ); script.type = 'text/javascript'; script.src = 'http://www.mydomain.com/bleh.php'; script.id =
I have fetched json through <script> function getjs() { var script =document.createElement(script); script.setAttribute(type,text/javascript); script.setAttribute(src,http://localhost:8080/vigs/f4json?user=3&callback=gr);
I'm looking at the http://code.google.com/chrome/extensions/contentSecurityPolicy.html documentation and seeing: { ..., content_security_policy: script-src 'self' https://example.com;
I've written this HAML: %script{:src => http://www.google.com/jsapi?key=mykey :type => text/javascript} Note the missing comma
UPDATE : I have the following code: <script type=text/javascript> function addScript(url) { var script
I using PHP/Javascript - Widget of alexmarandon from link http://alexmarandon.com/articles/web_widget_jquery/ And in project of
what does script.setAttribute('src', '/json?callback=loadJsonPhotos'); JavaScript code mean?
I am trying to get the src of all the script tags and i
Could you please tell me what does @src stands for in action script 3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.