dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Passing Javascript Replace function as an argument of user defined function

  1. #1
    Join Date
    Jul 2011
    Posts
    1

    Passing Javascript Replace function as an argument of user defined function

    Hi,

    I am facing a problem in passing replace() function as an argument in user defined java function, can any one help me how to resolve it?

    intention is to pass a file path to my user defined function, but before passing the path i want to replace the character '\' to '\\'

    I am posting my javascript function here:

    <a href="#" onclick="OpenDocPreview('<%# Eval("PATH")%>'.replace(/\\/g,"\\\\"), '<%# Eval("Filename")%>')"><%# Eval("DocTitle") %></a>


    function OpenDocPreview(url, docname) {
    alert('message from search base : ' + url + ' ' + docname);
    }

    thank you,

  2. #2
    Join Date
    Jul 2008
    Location
    urbana, il
    Posts
    2,787
    use json tools so you don't have to worry about escapes...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles