Page 1 of 11
uCoz Community » uCoz Modules » File Catalog, Site Catalog, Publisher, Ad Board, Online Games » Optimize Javascript/Code for Fast Page Loading
Optimize Javascript/Code for Fast Page Loading
khen
Posts: 436
Reputation: 13

Message # 1 | 6:48 AM
In order to pull out some data from the Profile Page, I'm using the following scripts in the Full Entry Page in my Ad Board module:

Code
<td style="width: 207px; text-align: left; vertical-align: top; letter-spacing: 0pt; word-spacing: 0pt;" valign="top">
  <div class="boxTable">
  <div class="header">
  Advertised By
  </div>
  <div class="boxContent">
  <div align="center" class="memberDbox">
  <script type="text/javascript">  
  $(document).ready(function()  
  {  
  $('span.getavatar').load('http://www.affordablecebu.com/index/8-$UID$ #getavatar');  
  });  
  </script> <a href="http://www.affordablecebu.com/index/8-$UID$" onclick="window.open('http://www.affordablecebu.com/index/8-$UID$','up$UID$','scrollbars=1,top=0,left=0,resizable=1,width=730,height=350');return false;"><span class="getavatar"></span></a>
   
  <br/>
  <script type="text/javascript">  
  $(document).ready(function()  
  {  
  $('span.getfullname').load('http://www.affordablecebu.com/index/8-$UID$ #getfullname');  
  });  
  </script> <a href="http://www.affordablecebu.com/index/8-$UID$" onclick="window.open('http://www.affordablecebu.com/index/8-$UID$','up$UID$','scrollbars=1,top=0,left=0,resizable=1,width=730,height=350');return false;"><span class="getfullname" style="text-transform:uppercase"></span></a>
   
  <div class="memberDetails">
  <b>Advertiser's Address</b>
  <div style="display:block; overflow: auto; width: 198px;">
  <script type="text/javascript">  
  $(document).ready(function()  
  {  
  $('span.getcity').load('http://www.affordablecebu.com/index/8-$UID$ #getcity');  
  });  
  </script><span class="getcity" style="text-transform:uppercase"></span>, 
   
  <script type="text/javascript">  
  $(document).ready(function()  
  {  
  $('span.getcountry').load('http://www.affordablecebu.com/index/8-$UID$ #getcountry');  
  });  
  </script><span class="getcountry" style="text-transform:uppercase"></span>
   
   
  </div>
  </div>
  <div class="memberDetails">
  <b>Contact Phone Number</b>
  <div style="display:block; overflow: auto; width: 198px;">
  <script type="text/javascript">  
  $(document).ready(function()  
  {  
  $('span.getphone').load('http://www.affordablecebu.com/index/8-$UID$ #getphone');  
  });  
  </script> <span class="getphone"></span>
  <br/>
  <script type="text/javascript">  
  $(document).ready(function()  
  {  
  $('span.getphone2').load('http://www.affordablecebu.com/index/8-$UID$ #getphone2');  
  });  
  </script> <span class="getphone2"></span>
  <br/>
  <span style="font-size:10px; color:red">Please quote affordableCebu.com when calling or texting.</span>
  </div>
  </div>
  <div class="memberDetails">
  <b>Advertiser's Other Ads</b>
  <div style="display:block">
  <script type="text/javascript">  
  $(document).ready(function()  
  {  
  $('span.getads').load('http://www.affordablecebu.com/index/8-$UID$ #getads');  
  });  
  </script> <span class="getads"></span>
  </div>
  </div>
  </div>
  </div>
  </div>



The result interface is:



(Sample url of this ad entry: http://www.affordablecebu.com/board....0-9366)

The data I've pulled out from the Profile Page are:
  • author's avatar
  • author's full name
  • author's complete address
  • author's phone numbers
  • author's other ad board entries


What I've notice is those data are loading very slow while the page is loading. Sometimes some of those data don't appear on the page. This affects my visitors' user experience negatively.

I'm not skilled on javascript. I need help from you guys on how to optimize the script or any other optimized codes on pulling out multiple data from the Profile Page. Please help me guys!

cry cry cry
Attachments: 7263915.jpg(74Kb)

Sunny
Posts: 9296
Reputation: 456

Message # 2 | 1:09 PM
khen, use only this:

Code
<script type="text/javascript">   
   $(document).ready(function()   
   {   
   $('span.getsf').load('http://www.affordablecebu.com/index/8-$UID$ #getsf');   
   });   
   </script> <span class="getsf" style="text-transform:uppercase"></span>


and put this in the "User's personal page" template:

Code
<span id="getsf"> put here all you need to pull out from the profile page </span>

I'm not active on the forum anymore. Please contact other forum staff.
khen
Posts: 436
Reputation: 13

Message # 3 | 4:56 AM
Thank you so much Sunny for the reply. But I didn't get it. Does it mean that I should customize my Profile Page and arrange the information in the Profile Page that will be shown in the Ad Entry?

In other words, what can be seen in my Ad Entry can be seen in my Profile Page?

Post edited by khen - Tuesday, 2013-06-18, 4:56 AM
Sunny
Posts: 9296
Reputation: 456

Message # 4 | 2:22 PM
khen, check your PM.
I'm not active on the forum anymore. Please contact other forum staff.
khen
Posts: 436
Reputation: 13

Message # 5 | 2:36 AM
Sunny, I can't say enough words on how to thank you and the uCoz team. uCoz team is really working hard helping uCoz users. uCoz team is really doing more than a great job!

You know what I like in uCoz? uCoz is awesome, cool and magnificient! cool

Я дуже щасливий. Я люблю Ucoz

Sunny
Posts: 9296
Reputation: 456

Message # 6 | 7:51 AM
khen, you are welcome wink
I'm not active on the forum anymore. Please contact other forum staff.
uCoz Community » uCoz Modules » File Catalog, Site Catalog, Publisher, Ad Board, Online Games » Optimize Javascript/Code for Fast Page Loading
Page 1 of 11
Search: