Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

<script> refs

Explorer ,
Nov 01, 2010 Nov 01, 2010

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

430
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 01, 2010 Nov 01, 2010

Passing a url variable into js?  First time I've ever seen that attempted.  Have you ever gotten that to succeed?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 01, 2010 Nov 01, 2010

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 01, 2010 Nov 01, 2010

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 01, 2010 Nov 01, 2010
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources