Solved

Coldfusion 8 Ajax and CFIDE as Virtual Folder throwing a javascript error

Posted on 2007-11-20
15
1,995 Views
Last Modified: 2013-12-24
For some strange reason I have a website that is unable to access the CF8 Ajax scripting libraries.

The website is not set up as the default website on the server (IIS 6.0 , Windows 2003), and the the CFIDE directory is virtual folder under that website.  Everything works inculding form field validation, Flash forms and so on, the only thing that doesnt is Ajax.  CFdiv would be a good example.  I get back and error for something as simple as

<cfdiv bind="url:TestPage.cfm"></cfdiv>

The error I get back is "Error processing Javascript markup for element cf_div1195589780172: [Enable debugging by adding 'cfdebug' to your URL parameters to see more information]"

Adding ?cfdebug=1 just gave me the same error.

This code does work however under the default website.  I checked security settings for the virtual directory and there is read and script access to the entire directory, so not sure what else I should be looking at to get this working.

0
Comment
Question by:Matt Grofsky
  • 8
  • 6
15 Comments
 
LVL 14

Expert Comment

by:Scott Bennett
ID: 20339973
Are you certain that the CFIDE directory you have created a virtual directory to contains all of the files in the /CFIDE/Scripts/ folder? the /CFIDE/Scripts/ folder should contain 1,887 files and 250 folders. if it only has 2 files then your virtual directory is pointed to an old version of the cfide directory.
0
 
LVL 2

Author Comment

by:Matt Grofsky
ID: 20340448
hmm ok I did a check and it contains 2,954 Files and 397 Folders.

It definitely has something to do with permissions I'm just not sure what it is.

I'm fairly certain that the appropriate rights are set, but not 100% sure since its not working.

But cfform.js is working without any issue as well as all the masks so not sure.

Virtual Directory is fairly straight forward, but here is an image of what I have in the way of setup.

http://66.193.54.196/untitled-1.gif 

This is exactly mimicked from the default website where ajax doesnt' give the error.
0
 
LVL 14

Expert Comment

by:Scott Bennett
ID: 20340851
You should leave the "Script Source Access" box unchecked. Enabling that setting gives people access to your source code which is a pretty big security risk.

Are the 2,954 Files and 397folders in the /CFIDE/Scripts folder or the whole /CFIDE/ directory. If you were just counting the Scripts folder then you have too many files in there if you are counting the whole CFIDE Directory then it looks like you have a few extra files and folders but the numbers are pretty close. I would suggest you use FireFox, Install the FireBug add on (https://addons.mozilla.org/en-US/firefox/addon/1843) and then use that to help you figure out if any particular files are missing.



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.

 
LVL 2

Author Comment

by:Matt Grofsky
ID: 20340995
Indeed, the scripts folder does have 1887 files and 250 folders so thats all good.  I was looking at the CFIDE dir before.

I went ahead and ran the page in firefox with firebug installed, but same errors.

Now I was messing arounf though and found something interesting.  The pag eI am trying to run is in a directory of the web www.domain.com/dir/

But if I move the page our of the sub directory and run it at the root it works.  I went ahead and tried fiddling with scriptsrc to see if that might be the issue  

<cfajaximport tags="cfdiv" scriptsrc="/../CFIDE/Scripts">
<cfajaximport tags="cfdiv" scriptsrc="../CFIDE/Scripts">
<cfajaximport tags="cfdiv" scriptsrc="/CFIDE/Scripts">

None worked.

Even tried creating a virtual directory CFIDE int he sub directory and that didnt work.
0
 
LVL 14

Expert Comment

by:Scott Bennett
ID: 20341322
when you are adding ?cfdebug=1 to your url and getting the same error, do you also have debugging enabled in coldfusion administrator?

you need to check the " Enable AJAX Debug Log Window " box on the " Debugging & Logging > Debug Output Settings" page in the administrator for the ?cfdebug=1 to work properly
0
 
LVL 2

Author Comment

by:Matt Grofsky
ID: 20341569
well I found what was causing this error, but cant seem to fix it.

It seems if I put in javascript at the top fo the page that does somethign else it interferes with the CF8 ajax.

In this case its for a dhtml menu

  <SCRIPT TYPE="text/javascript">
  var dmWorkPath="data.files/";
  </SCRIPT>

  <SCRIPT TYPE="text/javascript" SRC="data.files/dmenu.js"></SCRIPT>
0
 
LVL 2

Author Comment

by:Matt Grofsky
ID: 20341710
ok so I know whats going on now, but have no idea why or how to resolve it.

If I have something on the page like

<SCRIPT TYPE="text/javascript">
  alert('test');
  </SCRIPT>
 
 <cfajaximport tags="cfdiv">
<cfdiv bind="url:GetPorts.cfm"></cfdiv>

Everything works great, but if I take out the alert javascript from this page and put it into the application.cfm I get the error.
0
 
LVL 14

Expert Comment

by:Scott Bennett
ID: 20352882
Does the GetPorts.cfm that is bound to the cfdiv tag use the dhtml menu javascript?
0
 
LVL 2

Author Comment

by:Matt Grofsky
ID: 20353040
No the getports.cfm script just queries a database select count(*) as qryCount and then just does <cfoutput>#qrycount#</cfoutput>

the dhtml script wasnt the issue, the issue seemed to be putting any kind of javascript in the appliction.cfm file, have no idea why or how to resolve it but thats what causes the error to pop up.
0
 
LVL 14

Expert Comment

by:Scott Bennett
ID: 20353720
It could be that the javascript files you are using have a javascript variable name that is conflicting with one of the coldfusion or something.

You shoudn't be putting any display code in your application.cfm file, that's a pretty standard best practice "no no". Try putting that code into a header file that you include with each request. you might also try putting your other javascript into a function and then using the AjaxOnLoad function to execute the dhtml menu stuf after the ajax stuff is done loading.

http://livedocs.adobe.com/coldfusion/8/htmldocs/functions_a-b_06.html#5178573
0
 
LVL 2

Author Comment

by:Matt Grofsky
ID: 20378046
Well it isnt variables in the javascript because the below code doesnt work as well.

<SCRIPT TYPE="text/javascript">
  alert('test');
  </SCRIPT>

I have also tried in a heade rnot in application.cfm and that doesnt work either.  The code has to actually be in the processing page, not in any includes or in application.cfm

so what I ended up doing was just offloading all my javascript i put in the header and application.cfm and put it in the main page and it all works.

0
 
LVL 14

Expert Comment

by:Scott Bennett
ID: 20378620
I did actually run accross a similar  issue the other day with some javascript that wasn't working correctly with the th cfgrid tag I was working on, then the strange thing is I moved the javascript in between the <head></head> tags and then it all started working fine. try putting all your javascript in the head and see if it helps.
0
 
LVL 2

Author Comment

by:Matt Grofsky
ID: 20379611
hmm ya they are already between the <head> tags, tried moving gthem out though and same issue..wow frustrating  
0
 
LVL 2

Accepted Solution

by:
kc5sig earned 500 total points
ID: 21395121
Not sure if you found the solution to this or not but I'll add in my own recent experience and see if it helps -

I'm working on a CFTree and could not get the HTML version to come up.  Turns out that CF8 has some conflicting Javascript.

I was able to see the AJAX tree when I changed my debugging settings from Dockable.cfm to Classic.cfm in the debugging settings.
0
 
LVL 2

Author Closing Comment

by:Matt Grofsky
ID: 31410251
aha! that worked
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

Title # Comments Views Activity
Problem to go to page 12 94
ColdFusion 10 Error 2 50
How to generate a JSON response in coldfusion 4 47
SSL Certificate for IIS7 Site 2 21
Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

822 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