Send value to function doesnt work if it is LONGTE

2019-08-30 00:59发布

问题:

Im trying to send 3 database(mysql) values to a function when I click on a link. 2 of the values are VARCHAR in the db and the third is LONGTEXT, the VARCHAR values work as they should but not the LONGTEXT one? In the below link it is the "<%=rs("texten")%>" that doesnt work, the other to send the vaules as they should. The values from the db is:

rs("gallery_id"9 = 12

rs("big_image") = Armani1.jpg

rs("texten") = This is some test text,This is some test text,This is some test text,This is some test text,This is some test text,....

    > function uploadPost(gallery_id, big_image, headline, texten){
                var x=window.confirm("Ladda upp posten till din Facebook Wall?")
                if (x)
                uploadPost2(gallery_id, big_image, headline, texten);

            }


            function uploadPost2(gallery_id, big_image, headline, texten){

             $('#fbloader').append('<div id="facebookloader">UPLOADING TO FACEBOOK...PLEASE WAIT!</div>');
    var imgURL = 'http://www.mypage.com/user_images/<%=rs("folderName")%>/gallery/'+ big_image;

    FB.api('/<%=facebookUserId%>/feed/', 'post', {
                        method: 'stream.publish',                       
                        message: texten,

                        source : imgURL,

                        name   : headline,
                        link   : '<%=webpage%>',
                        description : ' '


    }, function(response){

          $('#fbloader').remove();
        if (!response || response.error) {
            alert('Error occured' +response.error);
        } else {



            $.get('updatefacebookpost.asp?gallerier_id=<%=gallerier_id%>&gallery_id='+gallery_id+'&facebookId=' + response.id);
             alert('Posten är uppladdad!\nPostens IDnr: ' + response.id );

        }
    });
}
    > 
    > 
    > 
<a href="#" onClick="uploadPhoto(<%=rs("gallery_id")%>,'<%=rs("big_image")%>','<%=rs("texten")%>');
        > return false;">post to facebook</a>

Its the "message: texten" that includes the text and send it to facebook. And if I change the database to VARCHAR for the <%=rs("texten")%> that the link gets, then it works, but not if it is LONGTEXT in the database? I hope you understand what I mean! Thanks.