Solved

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

Posted on 2007-11-20
15
1,993 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:Michin
  • 8
  • 6
15 Comments
 
LVL 14

Expert Comment

by:SBennett
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:Michin
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:SBennett
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
 
LVL 2

Author Comment

by:Michin
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:SBennett
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:Michin
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:Michin
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 14

Expert Comment

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

Author Comment

by:Michin
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:SBennett
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:Michin
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:SBennett
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:Michin
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:Michin
ID: 31410251
aha! that worked
0

Featured Post

Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Coldfusion remove square brackets from string 4 66
CSS HELP 6 74
System Analysis 5 41
Ways to assess https/ssl websites 3 57
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

21 Experts available now in Live!

Get 1:1 Help Now