FoxInCloud
Problem while showing an html page
Gravatar is a globally recognized avatar based on your email address. Problem while showing an html page
  Michele
  All
  May 22, 2020 @ 06:19am

I have a form where i show a google map.... In the init of the form (we made together with Thierry some time ago) i have this code:

Lparameters lcUser, lcHTML

If Pcount() > 0
	DoDefault()
	
	lcFile = JustFname(lcHtml)
	local oAJAX as awAJAX of awServer.prg
	if wlAJAX(@m.oAJAX)
		m.oAJAX.cScriptjsAdd(Textmerge([$('<<this.cntWeb.wcID>>').src="Maps/<<m.lcFile>>";]))
	EndIf

Here i receive a full local path of an html file generated to show a google map result... I have no error message and lcHtml is set corrected and it is in "Maps" folder When the form is shown nothing appears And if look in html properties i can see this:

And if i manually set src="maps\239847.html" (239847.html is the value of m.lcFile) the page is shown correctly Why i have "unknown" ?

Gravatar is a globally recognized avatar based on your email address. re: Problem while showing an html page
  Vincent H.
  Michele
  May 22, 2020 @ 06:58am

"maps..." instead of "Maps..." ?

Gravatar is a globally recognized avatar based on your email address. re: Problem while showing an html page
  Michele
  Vincent H.
  May 22, 2020 @ 07:13am

Nothing changes...

Gravatar is a globally recognized avatar based on your email address. re: Problem while showing an html page
  Vincent H.
  Michele
  May 22, 2020 @ 07:35am

I think the # is missing

m.oAJAX.cScriptjsAdd(Textmerge([$('#<<this.cntWeb.wcID>>').src="Maps/<<m.lcFile>>";]))
Gravatar is a globally recognized avatar based on your email address. re: Problem while showing an html page
  Michele
  Vincent H.
  May 22, 2020 @ 07:47am

Still no success..

Gravatar is a globally recognized avatar based on your email address. re: Problem while showing an html page
  Vincent H.
  Michele
  May 22, 2020 @ 07:56am

And this ?

m.oAJAX.cScriptjsAdd(Textmerge([$('#<<this.cntWeb.wcID>>').attr("src", "Maps/<<m.lcFile>>");]))
Gravatar is a globally recognized avatar based on your email address. re: Problem while showing an html page
  Michele
  Vincent H.
  May 22, 2020 @ 08:06am

Now it works... Thanks

Gravatar is a globally recognized avatar based on your email address. re: Problem while showing an html page
  FoxInCloud Support - Thierry N.
  Michele
  May 23, 2020 @ 02:09am

Ciao Michele,

This issue is because the code was originally written for prototype.js (deprecated) and your app. no longer loads this library; both prototype and jQuery use the $() function, however with a different meaning.

As jQuery is permissive (no error when passing a parameter out of scope), passing an html ID without the # selector (prototype syntax) triggers no error even if jQuery finds no matching element.

© 1996-2020