View Single Post
Old 01-25-2018, 10:15 AM   #2
psyang
Powerplay Quarterback
 
Join Date: Jan 2010
Exp:
Default

Quote:
Originally Posted by photon View Post
I added some Javascript from twitter that converts some HTML code into a full tweet.

https://twitter.com/user/status/952218108948811776

The only problem I don't like is using the quick reply or editing the post, it doesn't work since the javascript code is triggered with a window.onload.

But I'm not a javascript expert, is there any way I could change it so that it would also be triggered if someone uses the quick reply box to post a new post or edit an existing post?

Not that it matters much, just kind of weird that the embedded tweet doesn't show up in a first post.
It should be possible. I'm guessing "quick reply" makes an ajax call to the server to submit the new post, then dynamically updates the page when it gets the call's response. There is no page refresh, so no windows.onload event is triggered.

So, depending on what vBulletin allows, the simplest thing to do is trigger the twitter javascript on the callback from the post submission ajax call.
psyang is offline   Reply With Quote
The Following User Says Thank You to psyang For This Useful Post: