The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Problems adding javascript with "$" character (pretty much SOLVED)

View previous topic View next topic Go down

Solved Problems adding javascript with "$" character (pretty much SOLVED)

Post by strider99 on May 12th 2011, 5:19 pm

Hello,
I am new to this forum and to manage free hosted forums. Since I am a programmer, I was granted admin on our group free forum. I tried to add a personal widget (music player) and I chose jPlayer (great for me, give it a try)...
Well, after a little modeling I put the necessary code (javascript+html) into widget html, but wasn't working. So I noticed that AFTER saving every "$" character in the code was turned into its html code.. ( "$" is saved as "& # 3 6 ;"). Affects some javascript and jQuery. Although I found a workout for jQuery, there is really no way to rewrite javascript without using $.
I usually work on raw text files without any webeditor or cms, when I need to code something...
Is there a way to make $ to be saved as $ (escape character) or to upload text source file for a new html page?

Not sure if I posted to right section....
Example:
Want to save a $ in a widget (but same in an html page)

RESULT After SAVING Shocked

Confused .... Of course , after saving the Javascript won't work!


Last edited by strider99 on May 19th 2011, 4:05 pm; edited 5 times in total (Reason for editing : added $ html code & example)

strider99
New Member

Male Posts : 11
Reputation : 0
Language : english

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by strider99 on May 16th 2011, 8:38 pm

MMmm Nobody has a clue? Anyway this is an Admin panel bug, I suppose... since even if editing in plain html mode it still does tranlate characters into html....

strider99
New Member

Male Posts : 11
Reputation : 0
Language : english

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by Gangstar15 on May 16th 2011, 8:40 pm

Well, forumotion block the dollar sign Smile
so if you want to use a script like for jQuery then replace the dollar sign with jQuery (<-word)
or paste the script again after the dollar turned into & # 3 6 ;

Gangstar15
Forumember

Female Posts : 392
Reputation : 163

http://www.designdrops.net/

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by strider99 on May 16th 2011, 9:56 pm

I actually did replace dollar sign with jQuery, but I have other parts of script (not jquery) where I need to use dollar sign and cannot replace it. What do you mean past the script again after the dollar turned into & # 3 6 ; ? Pls explain...

strider99
New Member

Male Posts : 11
Reputation : 0
Language : english

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by Gangstar15 on May 16th 2011, 11:15 pm

first put the dollar sign in the widget, save it, then put your full script in the widget again Smile
And see the dollar turns into "& # 3 6 ;" Smile

Gangstar15
Forumember

Female Posts : 392
Reputation : 163

http://www.designdrops.net/

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by Guest on May 16th 2011, 11:22 pm

one question why does it change?

Guest
Guest


Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by Gangstar15 on May 16th 2011, 11:23 pm

I already said that in my first post Smile
But i don't know why forumotion blocks it Smile

Gangstar15
Forumember

Female Posts : 392
Reputation : 163

http://www.designdrops.net/

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by Guest on May 16th 2011, 11:25 pm

i meant why does it block it? is it because $ symbolizes a type of a money currency lol

Guest
Guest


Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by Gangstar15 on May 16th 2011, 11:26 pm

And i answer you, i said "I don't know why forumotion blocks it".

Gangstar15
Forumember

Female Posts : 392
Reputation : 163

http://www.designdrops.net/

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by Guest on May 16th 2011, 11:33 pm

@Gangstar15 wrote:And i answer you, i said "I don't know why forumotion blocks it".
firstly i corrected my question and secondly but the money thing it was a joke.i didnt ask you a question Razz

Guest
Guest


Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by Gangstar15 on May 16th 2011, 11:37 pm

ok.?

Gangstar15
Forumember

Female Posts : 392
Reputation : 163

http://www.designdrops.net/

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by Guest on May 16th 2011, 11:46 pm

so ok means ok or does it mean ok and still didnt get it Wink

Guest
Guest


Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by strider99 on May 17th 2011, 12:15 am

I think is a bug...

strider99
New Member

Male Posts : 11
Reputation : 0
Language : english

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by Guest on May 17th 2011, 12:17 am

yah i think so but we wont find out until a mod clarifies it to us

Guest
Guest


Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by strider99 on May 17th 2011, 2:21 am

@Gangstar15 wrote:first put the dollar sign in the widget, save it, then put your full script in the widget again Smile
And see the dollar turns into "& # 3 6 ;" Smile
BUt.. I have a scripts with dollar sign into it thatn NEEDS to be a dollar sign and not a "& # 3 6 ;"!!! have you found a workaround? bwi

strider99
New Member

Male Posts : 11
Reputation : 0
Language : english

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by Darren1 on May 17th 2011, 6:12 am

Hi,

The $ is not a bug, it's simply censored, because forumotion get spammed pretty massively by alot of netbots, they decided to censor alot of common words that spam bots tend to use. Unfortuntally, the $ is included.
It should be allowed within scripts and such.
Ill try and get Typlo's opinion on this Smile

Darren1
Helper
Helper

Male Posts : 11853
Reputation : 563
Language : English

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by strider99 on May 18th 2011, 12:10 am

tnx darren, I wanna use it in a javascript as explained in my 1st post... pls get back here when you know something, otherwise my script will never work on forum

strider99
New Member

Male Posts : 11
Reputation : 0
Language : english

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by Guest on May 18th 2011, 12:20 am

why dont you use a customized $ that wont be censored and its impossible to censor a custom one

Guest
Guest


Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by strider99 on May 18th 2011, 2:42 am

kamz89 wrote:why dont you use a customized $ that wont be censored and its impossible to censor a custom one
what do you mean?

strider99
New Member

Male Posts : 11
Reputation : 0
Language : english

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by Guest on May 18th 2011, 7:02 am

@strider99 wrote:
kamz89 wrote:why dont you use a customized $ that wont be censored and its impossible to censor a custom one
what do you mean?
for example you want this $ sign right now you cant add it to your widget because its censored so create yoour own type of a $ sign or write an s and draw a small line through it but make sure it has atleast 10 % difference then the original one then if you copy and paste it to your widget it wont be censored because its a custom $ GET IT?

Guest
Guest


Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by Darren1 on May 18th 2011, 8:43 am

You should be able to use the '$' in any scripts, jst make sure you use the tag script type=Javascript src="">
No need for a custom $ sign.
Just hit the +HTML Button and see the difference Smile

Darren1
Helper
Helper

Male Posts : 11853
Reputation : 563
Language : English

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by strider99 on May 18th 2011, 6:14 pm

@Darren1 wrote:You should be able to use the '$' in any scripts, jst make sure you use the tag script type=Javascript src="">
No need for a custom $ sign.
Just hit the +HTML Button and see the difference Smile

As explained in images in my 1st post, i used tag <script type="text/javascript"> </script> and the dollar signs are enclosed in this tag...

What's the difference between this and your proposed tag? Neutral

This is a bug, because censoring for bots does not apply in a javascript...

Anyways, I am using it in the Javascript replace() method, as part of a regular expression. I wouldn't know how to do it without using a dollar sign..

strider99
New Member

Male Posts : 11
Reputation : 0
Language : english

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by Darren1 on May 19th 2011, 4:11 am

As an alternate, put the css in a notepad file, and upload it somewhere, and use the code I used; it should work.
Otherwise, could you please post your script inside code tags, and Ill check it our for you, when I get a chance. I won't be online for the proceeding 50 or so hours.

Darren1
Helper
Helper

Male Posts : 11853
Reputation : 563
Language : English

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by kirk on May 19th 2011, 10:32 am

odd i dont have that on my phpbb2 board.

i can put $ sighs and it auto converts.

and at the top of my widgets setting all it says is

General options of the widget

not

General options of the widget : $ script

dunno.. i did have the test forum for a few years now so may be thats why?
meaning it's only for the newly created boards?? not sure?

kirk
Forumaster

Male Posts : 11037
Reputation : 651
Language : English,Vulcan,Klingon, Romulan,& Gorn

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by strider99 on May 19th 2011, 1:08 pm

@Darren... Tnx that's a good idea, will spot (elsewhere) a place where I can upload txt files, and put the src attribute to point to that source.. like this:
Code:
 <script type="text/javascript" src="http://placeWhereIuploaded.any/myJavascriptSource.js"></script>
If this does not work I'll post the source for you to manage. Anyways I am just trying to ad a jPlayer as a widget.

@Kirk Well I guess the picture says:
General options of the widget : $ script
.. because I created a Personal widget to show as an example...
maybe that's y...

strider99
New Member

Male Posts : 11
Reputation : 0
Language : english

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by strider99 on May 19th 2011, 3:19 pm

Very Happy
Ok I uploaded javascript source to www.yourjavascript.com (btw this site seems to be a nice resource for free-hosted blogs & forums, does not need a registration) and included external script source as shown in previous post.. and it works flawlessly.
It's still kinda of a work-around, since would be preferable to have javascript sources included inside forumotions resources (not having to load a whole bunch of external links when opening a page), but since $ is blocked even inside script tags, I think this is ok for now. If I was the forumotion staff, I'd consider removing autoconversion for $ to its html code when INSIDE script tags, when in plain html mode as it is more and more often used in scripts. But I understand that it might be a non-profitable operation....

Should I mark this thread as solved?


strider99
New Member

Male Posts : 11
Reputation : 0
Language : english

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by kirk on May 19th 2011, 3:26 pm

if you hare it solved you can mark as solved.

And no i created a personal widget as a test. and i do not have this problem at all plus mine don't say what yours dose.. so i think because my forum is older it was not effected for the change.. i think it's something forumotion put in place for newly created forums.

kirk
Forumaster

Male Posts : 11037
Reputation : 651
Language : English,Vulcan,Klingon, Romulan,& Gorn

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by strider99 on May 19th 2011, 3:43 pm

Yep, (sometimes) Old Style Rules! lol!
Marking Thread as Solved, but... if Forumotion will ever allow $ inside script tags give me a shout!!

I am testing it when a the new version of admin panel comes out...

(did I mark properly as SOLVED?)

strider99
New Member

Male Posts : 11
Reputation : 0
Language : english

Back to top Go down

Solved Re: Problems adding javascript with "$" character (pretty much SOLVED)

Post by Jophy on May 19th 2011, 7:52 pm

Solved

Jophy
ForumGuru

Male Posts : 17924
Reputation : 835
Language : English
Location : Somewhere

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum