fbharat
asked on
Displaying twitter feeds using javascript
Hi
I want to display twitter data of the users in twitter format. I have an api which returns twitter html's. I make an ajax call in javascript to the api and get the HTML data. But when i set the div innerHTML to the html data it does not display in twitter format. It displays in raw format. If have the same data written in the html directly under the div it displays in twitter format. I am attaching two files stream_old.html and test.html. In test.html i have copied that html data and it displays in twitter format.
In case of stream_old.html, i have made and ajax call and get the data and then set in the div, but it does not displays in twitter format. In both the files i have included the script <script async src="http://platform.twitter.com/widgets.js" charset="utf-8"></script>
stream_old.html hits an api https://stream.alphamaven.com/markets/lse/indices/ftse_100/cashtag_stream/oembed?uid=825060248, this is a continous stream of data. I have another API which returns fixed 3 tweets, even in that it is not displayed in twitter format.
Also attaching the a.js file required for stream_old.html
thanks
bharat
stream-old.html
test.html
a.js
I want to display twitter data of the users in twitter format. I have an api which returns twitter html's. I make an ajax call in javascript to the api and get the HTML data. But when i set the div innerHTML to the html data it does not display in twitter format. It displays in raw format. If have the same data written in the html directly under the div it displays in twitter format. I am attaching two files stream_old.html and test.html. In test.html i have copied that html data and it displays in twitter format.
In case of stream_old.html, i have made and ajax call and get the data and then set in the div, but it does not displays in twitter format. In both the files i have included the script <script async src="http://platform.twitter.com/widgets.js" charset="utf-8"></script>
stream_old.html hits an api https://stream.alphamaven.com/markets/lse/indices/ftse_100/cashtag_stream/oembed?uid=825060248, this is a continous stream of data. I have another API which returns fixed 3 tweets, even in that it is not displayed in twitter format.
Also attaching the a.js file required for stream_old.html
thanks
bharat
stream-old.html
test.html
a.js
ASKER
Hi
Can you please let me know what information is required for this. I have send all the files . if you run stream_old.html and test.html you will see the difference and i am sure it will help you decide the exact issue. Please let me know if any more information is required.
thanks
bharat
Can you please let me know what information is required for this. I have send all the files . if you run stream_old.html and test.html you will see the difference and i am sure it will help you decide the exact issue. Please let me know if any more information is required.
thanks
bharat
That is not a live page or even a valid page. All I can confirm from that is what I already know. You don't have the CSS being applied.
Cd&
Cd&
ASKER
Is there a way we can apply CSS or Js using innerHTML
thanks
bharat
thanks
bharat
Of course not. The styles need to be declared in the head of a valid page. There are multiple rules the have to be applied to the elements within each tweet.
All you have presented so far is a lot of hacked code. You are never going to get this sort of thing tp work without valid stable markup.
If you want further help, then I need a link to the page where you are trying to implement; not hacked fragments.
Cd&
All you have presented so far is a lot of hacked code. You are never going to get this sort of thing tp work without valid stable markup.
If you want further help, then I need a link to the page where you are trying to implement; not hacked fragments.
Cd&
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Then the styling is being generated dynamically from script. Also a hack, but when you rely on external code that is sometimes all that is available.
Cd&
Cd&
All you are going to get is speculation and guess without a link, and most Experts are going to ignore the question because there is not enough information to work with.
Cd&