Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Unknow tag on external JS file

Quote Reply
Unknow tag on external JS file
Hello everyboy,

Im trying to give my directory links a shdowbox link to display business address on my local directory from Google Map, and I'm wondering if anyone will know how can I pass the variable from my link.html template to my external JS in order to display the Google Map.

My JS code looks like this:

Code:
function verDireccion(){
Shadowbox.open({
player: 'html',
content: '',
height: 300,
width: 500,
options: {
onFinish: function(item){

if (GBrowserIsCompatible()) {
var body = document.getElementById(Shadowbox.contentId());
var map = new GMap2(body);
var geocoder = new GClientGeocoder();
var myLatLon = geocoder.getLatLng(
'<%Address%>', function(point) {
if (point) map.setCenter(point, 16);
if (point) map.addOverlay(new GMarker(point));
map.addControl(new GSmallMapControl());
}
);
}
}
}
});
}
As you can see on the code, im calling on the external JS my tag named: <%Address%>

Any help will be really appreciate it!

Jesus
Quote Reply
Re: [Jesus] Unknow tag on external JS file In reply to
Hi,

Not easy to see, with what we've seen - but something like:

Code:
function verDireccion(TheAddress){

..then change:

Code:
'<%Address%>', function(point) {

..to;

Code:
TheAddress, function(point) {

..and then when calling the function in your template, use:

Code:
verDireccion(<%Address%>)

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Unknow tag on external JS file In reply to
Hi Andy,

Thanks for your asnwer. I tried this but with no luck, as the link i'm using to call the js to display the address it doesnt work with the adjustment... here its the link I'm using:


Code:
<a onclick="verDireccion(<%Address%>);">View Map</a>
Once I did the adjustments you mention previously then the View Map link doesnt work, I'm probably missing something, thanks for pointing me to the right direction.

Jesus
Quote Reply
Re: [Jesus] Unknow tag on external JS file In reply to
Hi,

You probably need single quotes around it - ie

verDireccion('<%Address%>')

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Unknow tag on external JS file In reply to
Hi Andy,

It worked perfectly!

Thanks for your help again!

Jesus