Send value to function doesnt work if it is LONGTEXT in database?

老子叫甜甜 提交于 2019-12-12 03:11:16

问题


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.

来源:https://stackoverflow.com/questions/9499777/send-value-to-function-doesnt-work-if-it-is-longtext-in-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!