Facebook style ‘see more’ text onclick using php, mysql, Ajax and Javascript

Must Read : Facebook style ‘see more’ text onclick using php, mysql, Ajax and Javascript

This is small implementation in the last tutorial, as we discussed in the last tutorial, we know how to make insert and fetch data from database without refreshing the page, here i’m going to show you that, if i’m entering more number of data or texts in the field that will be shorten and make see more link, and to extract the full view of text, we have to make javascript hide and show concept for that, let see how i made it, in this. If you want to get clear idea from this you must have to see the previous tutorial i.e Insert and view data without refresh using PHP, MySql and AJAX.

most of them searching this concept to implement to their personal purpose. here i’m going to show you that, actually this is very very simple method. i did here. for this you must have to see the last tutorial. here i’m just showing you that how make see more button that’s it.
this concept is mostly used for going out of overflow, for that. made limited text only have display in the page and make see more or read more link for that. here i’m using Toggle concept to make this technique.
As we discussed in the last tutorial. we have to use 3 files to that, they are
  1. DB.PHP
  2. INDEX.PHP
  3. ACTION.PHP
here i’m going to made some small changes in the ACTION.PHP alone. let see the changes

ACTION.PHP

refer the previous tutorial for more file datails. and we must have include Jquery min file.

Refer the previous tutorial ACTION.PHP file details to get clear idea in that.  here i just made small changes in <div class=”showbox”> </div>. in the last tutorial i just echo the row data in that for small view of all data. here i’m using substr to show limited text form 0 to 25 letters, and php if condition with strlen for stringlength greater than 25 means make this link else default view.
and you must have to make call from the id so you have make class with the name of id.

for you clear idea. i just made CSS in the same line.
(Visited 125 times, 1 visits today)

Leave a Comment.