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 10 of 10
  1. #1
    New Coder
    Join Date
    May 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Server-Side into Client

    Hi,
    I want to have <%=adoRecordSet("mysite")%> into a client-side script (javascript) for an FCKEditor.

    This causes an error:

    Code:
    <script type="text/javascript">
    var oFCKeditor = new FCKeditor('text') ;
    oFCKeditor.BasePath	= '/editor/' ;
    oFCKeditor.Height	= 300 ;
    oFCKeditor.Value	= "<%=adoRecordSet('mysite')%>";
    oFCKeditor.Create() ;
    </script>
    <noscript>Javascript must be enabled to use this editor!</noscript>
    Is the quotation right? I'm extracting info from a database with SQL, and want that text preloaded.


    Thanks!

  • #2
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Unfortunately, the quotation is not... Remember that in all ASP code, single quotes will always comment out your code, breaking your app.

    Code:
    <script type="text/javascript">
    var oFCKeditor = new FCKeditor('text') ;
    oFCKeditor.BasePath	= '/editor/' ;
    oFCKeditor.Height	= 300 ;
    oFCKeditor.Value	= '<%= adoRecordSet("mysite")%>';
    oFCKeditor.Create() ;
    </script>
    <noscript>Javascript must be enabled to use this editor!</noscript>
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #3
    New Coder
    Join Date
    May 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Daemonspyre View Post
    Unfortunately, the quotation is not... Remember that in all ASP code, single quotes will always comment out your code, breaking your app.

    Code:
    <script type="text/javascript">
    var oFCKeditor = new FCKeditor('text') ;
    oFCKeditor.BasePath	= '/editor/' ;
    oFCKeditor.Height	= 300 ;
    oFCKeditor.Value	= '<%= adoRecordSet("mysite")%>';
    oFCKeditor.Create() ;
    </script>
    <noscript>Javascript must be enabled to use this editor!</noscript>
    Nope.
    Instead of the editor at ALL, it comes up.

  • #4
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    What comes up? Your recordset? Or another error?
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #5
    New Coder
    Join Date
    May 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it comes up with literally nothing!

  • #6
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Here's a question -- Are you using Firefox or IE?

    If Firefox, then you need get the WebDeveloper and Firebug add-ons. It's probably a Javascript issue, not an ASP issue.

    If you are using IE -- Switch to Firefox, get the add-ons, and then you will have that many more tools to help you code correctly!.
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #7
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,065
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Why not just use the ASP version of the fckeditor?

  • #8
    New Coder
    Join Date
    May 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    How do i convert all this ASP VBScript into ASP JavaScript??

  • #9
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Since VBScript and JavaScript are written totally differently, you are going to have to either retool your app or just try to fix the issue.

    Try viewing the source... What does the same snippet of code say when you view the source of your app?

    Also, you said that <%= adoRecordset("mySite") %> was stopping your app from working.

    What does a
    Code:
    <% 
    response.write(adoRecordset("mySite"))
    response.flush
    %>
    return in your code? If it returns something like:

    Code:
    oFCKeditor.Value = 'http://www.mysite.com/test.asp?var=12345';
    you should be fine.

    BUT if it has URL Encoded characters (%22 ["], %2C [,], %3F [?]) you may run into issues.
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #10
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,065
    Thanks
    4
    Thanked 8 Times in 8 Posts
    You can build the FCKEditor editor using asp code. Here is a working example from one of the sites I have done


    Code:
    <!-- #INCLUDE file="fckeditor/fckeditor.asp" -->
    <%
    Dim oEditor
    Set oEditor = New FCKeditor
    oEditor.BasePath = "/admin/fckeditor/"
    oEditor.ToolbarSet = "Basic"
    oEditor.Value = "<h2 style=""text-align:center; color:#C00;"">Warning!</h2><h5 style=""text-align:center;"">If pasting from a Microsoft Word document, use the Paste From Word option to clean the text.</h5>" & _
    	"<div style=""padding-left:100px;""><strong>To remove this notice, follow theses steps: </strong><ol><li> click your mouse inside the editor</li><li> click ctrl-a</li><li> click ctrl-x</li></ol></div>"
    oEditor.Create "Description" 
    Set oEditor = Nothing
    %>


  •  

    Posting Permissions

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