Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2007-11-20
15
Medium Priority
?
2,005 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

 
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 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
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.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

618 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