开发者

Adding links to text from an html textarea

Is this possible? What I would like to do is designate certain text that the user writes in a text area as a link. This text is inserted into a MySQL database then pulled, and displayed elsewhere. Also the links will never really b开发者_JAVA技巧e in the same spot.


You could could use jQuery to grab the value of the textarea on change and use ajax to send it to a php page which logs it to a mysql db, then use jQuery setInterval/ajax combo to pull back results from the php/mysql to put elsewhere on your page :)

Also you can construct the link in the php then just send back html to your page


Can you describe this process a bit more? How will the specific text within the textarea be known to be a "link"? What will it link to? (Side note, be very careful with cross-site-scripting and such. A JavaScript command can be in a link.)

Why not use a rich text editor which allows the user to create links? Maybe something that supports markdown like this site does?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜