I need insert this javascript into posts

Started by t2hol, November 24, 2015, 10:24:36 PM

Previous topic - Next topic

t2hol

Hello
I known there is no option to put java script into post body however I really need it. My forum has coupon section and I want use click the button to open affiliate page and get coupon. Below is the javascript code.

<input onclick=" window.open('http://www.maindomain.com/go/stablehost'); &nbsp;s=prompt('Please copy and use the coupon code below:','fbhpg30') &nbsp; " type="button" value="View coupon">

Please help, I really need this hacks

Or can I create a custom field for post and insert the script above into the box ?
http://www.wpse.net [nofollow]

Kindred

As an admin, you could do it using the Http BBC tag...    But it's a bad dea, in general
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

t2hol

Sorry for stupid question but where is it ? I didn't see this tag on the editor
http://www.wpse.net [nofollow]

Kindred

It is not expose, because it is a security risk, plus only the admin can use it.. Just put HTML in brackets, like any other BBC tag.

However, it's a bad idea, in general...  Maybe one of the ad mods would be a better choice?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

t2hol

There is a custom field for content post I found but it's not compatible with SMF 2.0.11 :(
http://www.wpse.net [nofollow]

Kindred

As an admin, as I told you, you don't need a custom field...   Additionally, any custom field with any amount of security would not allow JavaScript anyway
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: