SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript Code To String variable

    Whether there is a utility for transformation Javascript code in a line variable?
    example:
    Code:
    var a = "<script type=\"text/javascript\">function OnChangeRiskBrand() {  UpdateLink_RiskBrand() } </script>"

  2. #2
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why do you need script tag?

    Code:
    var a = function () {UpdateLink_RiskBrand();} // is inline function only.

  3. #3
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)
    Hi kodermax, welcome to the forums,
    What you have shown is assigning the code string to a variable.
    What are you trying to do with it?

  4. #4
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mittineague View Post
    Hi kodermax, welcome to the forums,
    What you have shown is assigning the code string to a variable.
    What are you trying to do with it?
    Yes
    This is need for Business Objects.

  5. #5
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)
    I'm a bit of an OOP newbie, but you should be able to pass the string to an object. It would help to see the context. What code to you have so far.


Bookmarks

Posting Permissions

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