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 3 of 3

Thread:   Problem

  1. #1
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

      Problem

    My variable is subject and the value of my variable will be Hello World

    Here is my code:

    var myEvent = new WoopraEvent("postevent"); // Initialize event and give it a name
    myEvent.addProperty("apost","<?php echo $subject; ?>" );
    myEvent.fire();

    Here is my problem. When I look at the source code when the page loads, this shows.

    var myEvent = new WoopraEvent("postevent"); // Initialize event and give it a name
    myEvent.addProperty("apost","Hello&nbsp;world" );
    myEvent.fire();

    How can I make it show the space instead of &nbsp;

    Thanks!

  • #2
    Senior Coder DJCMBear's Avatar
    Join Date
    Mar 2010
    Location
    United Kindom
    Posts
    1,173
    Thanks
    14
    Thanked 136 Times in 136 Posts
    Quote Originally Posted by j115 View Post
    My variable is subject and the value of my variable will be Hello World

    Here is my code:

    var myEvent = new WoopraEvent("postevent"); // Initialize event and give it a name
    myEvent.addProperty("apost","<?php echo $subject; ?>" );
    myEvent.fire();

    Here is my problem. When I look at the source code when the page loads, this shows.

    var myEvent = new WoopraEvent("postevent"); // Initialize event and give it a name
    myEvent.addProperty("apost","Hello&nbsp;world" );
    myEvent.fire();

    How can I make it show the space instead of &nbsp;

    Thanks!
    Do you have "&nbsp;" in you subject string already or does it just show up?
    Official BinPress hand picked coder.
    For anyone worried about SQL injection go have a look at my small yet powerful script here.
    Go Pledge for Light Table, if it hit's $300,000 Python and other languages will get added.
    I am 1 of 65,608 people to get a Pebble Watch :P

  • #3
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    You could try this:
    PHP Code:
    var myEvent = new WoopraEvent("postevent"); // Initialize event and give it a name
    myEvent.addProperty("apost","<?php echo html_entity_decode($subject); ?>" );
    myEvent.fire();
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting


  •  

    Posting Permissions

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