Copy link to clipboard
Copied
Trying to troubleshoot a problem with a Digital Crew UDI component, which seems to be having trouble locating some <script> files, i.e. I get a bunch of "object expected" errors on all of the javascript functions unless I copy the <script> file into the caller. Unfortunately this isn't a solution becuase I've got many script tags pointing to a whole host of files. So my question is "Is there a switch to tell it to use relative or fully quallified paths for script files?" Originally my tag looked like this:
<script language="JavaScript1.2" src="js_editrecord_dyn.cfm?ref=<cfoutput>#ref#</cfoutput>"></script>
but I've also tried this without any luck:
<script language="JavaScript1.2" src="/dcCom/components/udi/js_editrecord_dyn.cfm?ref=<cfoutput>#ref#</cfoutput>"></script>
Thanks
Copy link to clipboard
Copied
Passing a url variable into js? First time I've ever seen that attempted. Have you ever gotten that to succeed?
Copy link to clipboard
Copied
This isn't my code, it comes from the Digital Crew, UDI component. I'm assuming it works since I've got it scattered across dozens of in-house applications that work. I don't know why it's having trouble loading this <script> file and not the ones in the other applications. As I mentioned previously it appears to be having trouble resolving the path, since if I copy the contents of the <script> file into the caller the errors go away.
Copy link to clipboard
Copied
If you pass this:
/dcCom/components/udi/js_editrecord_dyn.cfm?ref=<cfoutput>#ref#< /cfoutput>">
into the caller, how does the js pick up the value of #ref#?
For the pages that it does work, is it sending a variable?
Copy link to clipboard
Copied
I don't think the js knows or cares how it gets the value. The
tag is just a string in another file. It gets built by cf on the server. By the time the client processes the js, cf's already done it's work and it's just a text file.