/    Sign up×
Community /Pin to ProfileBookmark

Greybox and javascript not working

Hi there, i want to use greybox for opening some links. the thing is that those links are given with javascript. If i just place the javascripts in the <head></head> section then the javascript that gives the links does not work. to solve this, i put this in the javascript

document.write(‘<scr’ + ‘ipt type=”text/javascript”>var GB_ROOT_DIR = “myurl/greybox/”</scr’ + ‘ipt>’);
document.write(‘<scr’ + ‘ipt type=”text/javascript” src=”./greybox/AJS.js”></scr’ + ‘ipt>’);
document.write(‘<scr’ + ‘ipt type=”text/javascript” src=”./greybox/AJS_fx.js”></scr’ + ‘ipt>’);
document.write(‘<scr’ + ‘ipt type=”text/javascript” src=”./greybox/gb_scripts.js”></scr’ + ‘ipt>’);

I then put rel=”gb_page_fs” in the <a href>. the link opens in a new tab.

<a href=”‘+link+'” title=”‘+title+'” rel=”gb_page_fs” target=”+link+”>’+title+'</a>

Other links in the page with the use of rel=”gb_page_fs” work. any ideas???
thank you

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @sportbilly spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...