CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   DOM and JSON scripting (http://www.codingforums.com/forumdisplay.php?f=15)
-   -   Entity reference not resolving (http://www.codingforums.com/showthread.php?t=288620)

sbhmf 03-01-2013 08:45 PM

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 03-01-2013 09:04 PM

slight modification resolved issue:
 
changed .text(...) to .html(...).
more info at http://api.jquery.com/text/

sunfighter 03-04-2013 04:34 PM

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?

sbhmf 03-08-2013 07:40 AM

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.


All times are GMT +1. The time now is 03:11 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.