Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-01-2013, 08:45 PM   PM User | #1
sbhmf
New Coder

 
Join Date: Jan 2013
Location: Sunnyvale, CA
Posts: 44
Thanks: 3
Thanked 1 Time in 1 Post
sbhmf is an unknown quantity at this point
Entity reference not resolving

the js code:

Code:
var sig = $('.sig').eq(0);
var lst = '•'; //should resolve to bullet.
$(sig).find('.lst').text(lst);
the xhtml code:

Code:
<div class="sig">
<div>
<span class="lst">&bull;</span> <!-- entity reference remains literal. -->
<input name="txtItem" type="text" class="textbox" value="" />
</div>
</div>
sbhmf is offline   Reply With Quote
Old 03-01-2013, 09:04 PM   PM User | #2
sbhmf
New Coder

 
Join Date: Jan 2013
Location: Sunnyvale, CA
Posts: 44
Thanks: 3
Thanked 1 Time in 1 Post
sbhmf is an unknown quantity at this point
slight modification resolved issue:

changed .text(...) to .html(...).
more info at http://api.jquery.com/text/
sbhmf is offline   Reply With Quote
Old 03-04-2013, 04:34 PM   PM User | #3
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,498
Thanks: 18
Thanked 361 Times in 360 Posts
sunfighter is on a distinguished road
Javascript naming rules:
A variable name has to start with
_ (underscore)
$ (currency sign)
a letter from [a-z][A-Z] range
an Unicode letter in the form \uAABB (where AA and BB are hex values)

Notice it can NOT start with a number

var lst = '&bull;'; //should resolve to bullet.

P.S. Don't understand your question nor your code. Where does bullet come from and more?
sunfighter is offline   Reply With Quote
Old 03-08-2013, 07:40 AM   PM User | #4
sbhmf
New Coder

 
Join Date: Jan 2013
Location: Sunnyvale, CA
Posts: 44
Thanks: 3
Thanked 1 Time in 1 Post
sbhmf is an unknown quantity at this point
I suspect that my code is a bit confusing...

'.lst' is jQuery notation referencing an element with the classname 'lst'

var lst is a js variable whose value is '&bull;', yes, a bullet.

I appreciate everyone's collaboration, but no need to lose sleep over this one since it has been resolved.
sbhmf is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:37 PM.


Advertisement
Log in to turn off these ads.