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 6049273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:33:25+00:00 2026-05-23T07:33:25+00:00

I am trying to make a link that tweets the dynamically dreated content of

  • 0

I am trying to make a link that tweets the dynamically dreated content of a number of divs all as one sentence

The Javascript

function toggle(){
      var joe = document.getElementById("fulltxt");
      document.getElementById("tweet").setAttribute('href','http://twitter.com/home?status=' + 

joe.innerHTML)
  }

The content i want to tweet

<div id="fulltxt">
<div id='action'> actiontext </div>
<div id='reason'> reasontext</div>
<div id="party"> partytext </div>
</div>

the link to tweet

<a id="tweet" href='#' onClick="toggle(this.value)">שתף בטוויטר</a>

The problem i am getting is

Invalid Unicode value in one or more parameters /intent/tweet?source=webclient&text=%3Cdiv+id%3D%22action%22%3E%F9%EC%E5%ED%3C%2Fdiv%3E%E5%E6%E4+%E1%E2%EC%EC%3Cdiv+id%3D%22party%22%3E%E1%E9%E1%E9+%F0%FA%F0%E9%E4%E5%3C%2Fdiv%3E

There could be two problems

  1. the html tags – so instead i would need string together the individual div’s (action + reason + party) instead of using fulltxt
  2. the language – (its its in hebrew) I think it may be an encoding issue

to test it, i replaced fulltxt in the function with the id of one of the individual divs and when the content of the individual div is in english it works but when its in hebrew it gives me an error

  • 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-23T07:33:26+00:00Added an answer on May 23, 2026 at 7:33 am

    You are correct it is an encoding issue. Also innerHTML will include the tags of the nested divs.
    IE supports innerText and the rest use textContent

    function toggle(){
      var joe = document.getElementById("fulltxt");
      var text = joe.textContent?joe.textContent:joe.innerText;
      document.getElementById("tweet").setAttribute('href','http://twitter.com/home?status=' + 
      encodeURIComponent(text);
    }
    

    encodeURIComponent

    Encodes a Uniform Resource Identifier
    (URI) component by replacing each
    instance of certain characters by one,
    two, three, or four escape sequences
    representing the UTF-8 encoding of the
    character (will only be four escape
    sequences for characters composed of
    two “surrogate” characters).

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

Sidebar

Related Questions

Trying to make a make generic select control that I can dynamically add elements
I am trying to to make link inside a div button that when you
I'm trying to make a simple link that will toggle my status attribute in
I am trying to link database servers and I noticed that one is named:
I'm trying to make a context menu for a control that is linked to
I am trying to make a div, that when you click it turns into
I am trying to make a JTable that has column spans available. Specifically, I
I am trying to make a simple program that handles files and directories, but
I'm trying to make a pseudo link class with the CSS3 text-shadow for both
I am having a problem, I am trying to make a link for a

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.