Solved

Using cfajaximport

Posted on 2009-05-19
3
1,253 Views
Last Modified: 2013-12-20
I use two tags cfwindow and when i use coldfusion.ajax.submit, i have to use cfform in

<cfajaximport tag="cfform,cfwindow">

Now this stuff makes my website so slow and that it takes a hell lot of time to view properly.

more than 1 minute.

I am just fed up. when i view source, it just gets bunch of cfajax stuff as:

so can anyone tell why this happens. not using anyframework, nor i have any experience using anyframework.

<html xmlns="http://www.w3.org/1999/xhtml">

<head><script type="text/javascript">_cf_loadingtexthtml="<img alt=' ' src='/CFIDE/scripts/ajax/resources/cf/images/loading.gif'/>";

_cf_contextpath="";

_cf_ajaxscriptsrc="/CFIDE/scripts/ajax";

_cf_jsonprefix='//';

_cf_clientid='C68449E26E9233D63112B1C9D18C04F4';</script><script type="text/javascript" src="/CFIDE/scripts/ajax/messages/cfmessage.js"></script>

<script type="text/javascript" src="/CFIDE/scripts/ajax/package/cfajax.js"></script>

<script type="text/javascript" src="/CFIDE/scripts/ajax/yui/yahoo-dom-event/yahoo-dom-event.js"></script>

<script type="text/javascript" src="/CFIDE/scripts/ajax/yui/animation/animation-min.js"></script>

<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/adapter/yui/ext-yui-adapter.js"></script>

<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/ext-core.js"></script>

<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/resizable.js"></script>
 

<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/dragdrop/dragdrop.js"></script>

<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/util.js"></script>

<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/build/state/State-min.js"></script>

<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/widget-core.js"></script>

<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/dialog/dialogs.js"></script>

<script type="text/javascript" src="/CFIDE/scripts/ajax/package/cfwindow.js"></script>

<script type="text/javascript" src="/CFIDE/scripts/cfform.js"></script>

<script type="text/javascript" src="/CFIDE/scripts/masks.js"></script>

<script type="text/javascript" src="/CFIDE/scripts/cfformhistory.js"></script>
 

<link rel="stylesheet" type="text/css" href="/CFIDE/scripts/ajax/resources/ext/css/ext-all.css" />

<link rel="stylesheet" type="text/css" href="/CFIDE/scripts/ajax/resources/cf/cf.css" />

Open in new window

0
Comment
  • 2
3 Comments
 
LVL 27

Expert Comment

by:azadisaryev
ID: 24427956
yep, that's just how cf ajax features work. cf loads up a total of about 500KB of javascript code whenever you use its built-in ajax features.

regarding <cfajaximport>: you only need to import tags that are not already used in your page. i.e. if you do have <cfwindow> tag somewhere in the code of your page, you DO NOT need to import it. however, if the external page you load in your cfwindow uses a cfform, you DO need to import cfform tag. similarly, if you are using cf functions to create a cfwindow instead of actual <cfwindow> tag, then you also DO need to import the tag.

there are multiple alternatives to using built-in cf ajax features. what cf actually uses is YUI components, ExtJS and FCKEditor. you can implement all those yourself, without using cf's built-in implementation of them, however, it is NOT going to be as easy as putting <cfwindow> tag in your code...

there are also other js libraries which have similar controls either built-in or available as plug-ins, of which jquery and jqueryUI really shine...

but, even when using those js libraries directly (instead of using cf's implementation of them), you will still be loading up to 300KB of extra js...

as to why your site is so slow - i would look into your web server configuration, implement some server-side caching and gzip complression... that is if it is your server. if you are on shared hosting, there is really nothing you can do...

Azadi
0
 
LVL 15

Author Comment

by:Gurpreet Singh Randhawa
ID: 24428410
i am on shared host. hostingatoz<input id="gwProxy" type="hidden"><!--Session data--><input onclick="jsCall();" id="jsProxy" type="hidden">
0
 
LVL 27

Accepted Solution

by:
azadisaryev earned 500 total points
ID: 24428503
well, that makes making changes to your server out of the question...

basically, the bottom-line is: if you want the ease-of-use of built-in cf ajax features, then you have to live with the extra payload of javascript and css cf adds to your pages. if this payload is too much for you, then you will have to code your own ajax widgets and functionality using jquery or other ajax-enabled js library. jquery does make it fairly easy, but not as easy as <cfwindow>... you DO need to know your javascript 101...

Azadi
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to solve ssl error handshake failure alert on IE 1 167
Annoying "thing" blocks my view 4 82
Align a <div> to a table row 3 58
DNS @ Naked Domain Record 5 69
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

867 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now