Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 329
  • Last Modified:

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

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
Nigel-SA
Asked:
Nigel-SA
  • 6
  • 5
1 Solution
 
reitersCommented:
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
 
Nigel-SAAuthor Commented:
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
 
reitersCommented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Nigel-SAAuthor Commented:
Attached see the IE error that is displayed when the function is loaded on the ext server.
IE-Error-undefined.jpg
0
 
reitersCommented:
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
 
Nigel-SAAuthor Commented:
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
 
reitersCommented:
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
 
reitersCommented:
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
 
Nigel-SAAuthor Commented:
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
 
Nigel-SAAuthor Commented:
thanks for the comments
0
 
reitersCommented:
Glad you figured it out.  The simplest thing can be the most frustrating.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now