Solved

CFGRID: Same .cfm page works fine on dev server but issues on prod server

Posted on 2010-09-16
11
306 Views
Last Modified: 2012-05-10
We have the same .cfm page that works fine on development server but has issues on production or ext server like:
- <cfset ajaxOnLoad("xxxxxx")> doesn't load correctly
- can't use mouse roller ball to scoll on data grid - wierd

cfgrid ="html"

Have these loaded:
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/ext-all.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/toolbar/toolbar.js"></script>  
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/button/button.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/menu/menus.js"></script>

Using CF8: all versions, patches and settings the same on both servers. Any ideas, hope this makes sense - it's driving us crazy!!

0
Comment
Question by:Nigel-SA
  • 6
  • 5
11 Comments
 
LVL 6

Expert Comment

by:reiters
ID: 33693382
Use firefox with firebug and turn on the "console" it will help you to see what is being requested as well as what is being returned.  Is the ajaxonload calling an external link.  I think JS has some issues with external links.  They have to be handled a little different I think.  It's a security feature.  Also keep in mind that foo.com and www.foo.com are different domains to JS and will be treated as an external link.
0
 

Author Comment

by:Nigel-SA
ID: 33694702
Thanks Reiters looking into it, trouble is my work environment does not allow me to install FireFox :(   The webmaster ran it and showed me an image on a boat load of errors found on that page. Trying to get a waiver to use FF.  Any hints on what to look for?
0
 
LVL 6

Expert Comment

by:reiters
ID: 33695173
Any time you are using ajax, firebug is your best friend, but as you say you can not use it.  Fiddler2 is an alternative but if you can't have FF then you are probably not allowed that either.  CSS error are normal with JS libraries because they use the both IE and FF equivalents of how to do things knowing that the browser it doesn't belong to will ignore it.  Hope that made sense.  I had a hard time wording that.  JS errors on the other hand will halt JS execution.  If you have a JS error, the rest of your JS may not being run.  If the screenshot is all the JS errors then you should try to work through them and it may start working for you.
0
 

Author Comment

by:Nigel-SA
ID: 33715131
Attached see the IE error that is displayed when the function is loaded on the ext server.
IE-Error-undefined.jpg
0
 
LVL 6

Expert Comment

by:reiters
ID: 33716698
Can you run the page and copy the rendered page and put it here.  You can remove anything company related.  It will be very difficult to troubleshoot the JS without being able to go over it.  I completely understand if you can't do that, but understand I can't troubleshoot without it.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:Nigel-SA
ID: 33716750
Unfortunately I'm unable to, but I found on http://www.coldfusionguy.com/ColdFusion/blog/index.cfm/2007/11/28/CF8-AJAX-Features-Validating-CFGrid-Data

"Make sure that the <script> block that contains your init() javascript function is in within the <head> and </head> tags. The ext stuff can be picky if you don't define all your javascript functions in the head of the html."

I'll try this and see what happens - only tomorrow as the web guy is out today.
0
 
LVL 6

Accepted Solution

by:
reiters earned 500 total points
ID: 33717054
I've had many issues with running CFs UI stuff inside an AJAX loaded divs.  The thing throwing me off is that you stated it works on dev but not in production.

Something that might help that I found recently (been there for a long time).

<cfhtmlhead text='<link href="favicon.ico" rel="shortcut icon" type="image/x-icon">#chr(13)##chr(10)#'>

It allows you to put something in the <head> section of the page but it can be placed later on the page.  I assume CF sees those during the compiling of the page and moves it to the head.  That means it's great if you conditionally cfincluded pages, but will NOT work for AJAXed in content because those pages are called in after compile time.  For example.  I have a site that I work on that it really old code from a non-programmer and I do not want to include all the jQuery files across the whole site, but I added a form and wanted to use the calendar UI so I <cfhtmlhead> the jQuery files on my page and don't have to modify the global header file and the jQuery files will be in the head.

For running CF's UI stuff inside AJAXed div I have had to put functions on the main page that are then called from the ajaxonload from within the AJAXed content.  The function is just a wrapper for the call you want that resides on the main page but gets triggered from withing the AJAXed content.

One site I worked on had TONS of CF AJAX on it and after 6 months of fighting issues like these I switched to jQuery.  It's all smooth sailing from there.

Keep in mind that the way CF handles the AJAX it to "process" your javascript and in some cases rewrite it before it sends it to the browser.  If it can't figure out what you are trying to do it will just leave it out.  Very frustrating.

always use the format
foo  = function() {
}
and not
function foo() {
}

otherwise CF will just throw it out.

A lot of babbling there but since I can't see the code I'm trying to point you in the right direction.
0
 
LVL 6

Expert Comment

by:reiters
ID: 33717151
One last thing... In some cases it's much easier to use an IFRAME around some content.  I know some will hate me for saying that but it can be the only way sometimes.

Example: Try putting a video in a CFWindow using current "proper" method of creating the object using JS.  You will be fighting it AND it will work weird in IE.  I think you can move the window but the video stays in it's original location if I remember correct.

Remember that if you use an iframe that it will need its own
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/ext-all.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/toolbar/toolbar.js"></script>  
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/button/button.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/menu/menus.js"></script>

because they don't get pushed into iframes.
0
 

Author Comment

by:Nigel-SA
ID: 33725514
reiters - IT WORKS - thanks for all the input - turns out my error in the end was something real simple - I left out the </head> tag  :(  but hey, I learned tons of things from you - gotta love this programming!!!
0
 

Author Closing Comment

by:Nigel-SA
ID: 33725529
thanks for the comments
0
 
LVL 6

Expert Comment

by:reiters
ID: 33730950
Glad you figured it out.  The simplest thing can be the most frustrating.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

747 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

11 Experts available now in Live!

Get 1:1 Help Now