Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jan 2013
    Location
    Sunnyvale, CA
    Posts
    144
    Thanks
    11
    Thanked 7 Times in 7 Posts

    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>

  • #2
    Regular Coder
    Join Date
    Jan 2013
    Location
    Sunnyvale, CA
    Posts
    144
    Thanks
    11
    Thanked 7 Times in 7 Posts

    slight modification resolved issue:

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

  • #3
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,722
    Thanks
    25
    Thanked 662 Times in 661 Posts
    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?

  • #4
    Regular Coder
    Join Date
    Jan 2013
    Location
    Sunnyvale, CA
    Posts
    144
    Thanks
    11
    Thanked 7 Times in 7 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •