Solved

page using jquery.shorten.js is refreshing

Posted on 2014-09-25
7
144 Views
Last Modified: 2014-09-27
I have a html page showing multi rows of data using jquery.shorten.js.
In firefox it shows the uncompressed rows initially and then it shows the compressed version (kind of looks like refreshing the page)

    <script type="text/javascript" src="images/crm/jquery.shorten.js"></script>
    <script type="text/javascript"> $(document).ready(function(){ $(".comment-
    small").shorten({showChars: 100});});</script>

The 100 rows show up like as below

    <div class="comment-small">My data in row1 ............................. </div>
    <div class="comment-small">My data in row2 ............................. </div>

How can we avoid this refresh please?
0
Comment
Question by:G J
  • 4
  • 3
7 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 40345287
add this CSS :
<style>
.comment-small {
    display:none;
}
</style>

Open in new window


and unhide after :
$(".comment-small").shorten({
    moreText: 'read more'
});
$(".comment-small").show(); // here we unhide

Open in new window

0
 

Author Comment

by:G J
ID: 40346047
It still does the refresh though.
Only difference is, earlier it used to show the uncompressed text and then  refreshed and showed the compressed text with "read more" at the end.
Now it shows nothing first and then refreshes and shows the compressed text with "read more" at the end.
0
 
LVL 82

Expert Comment

by:leakim971
ID: 40346054
could you provide a link to see that in live?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:G J
ID: 40346134
My stuff is inside the firewall. I think I see where the problem could be though.
The page (http://example.com/page2) if run directly does not refresh.

But the page is currently called from a tab2(gave the code below)  THEN it refreshes.
Do you know why please?


<div id="tab1">
  <ul>
    <li><a href="http://example.com/page1">Tab1</a></li>
    <li><a href="http://example.com/page2">Tab2</a></li>
  </ul>
</div>
<script>$("#tab1").tabs({active:1});</script>
0
 

Author Comment

by:G J
ID: 40346188
The above uses ui tabs from jquery-ui.js .
0
 
LVL 82

Expert Comment

by:leakim971
ID: 40346211
sorry wrong post
0
 

Author Comment

by:G J
ID: 40346266
That's ok. I looked at your post and was wondering.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question