/    Sign up×
Community /Pin to ProfileBookmark

a link inside JS

Hi, i am experimenting with a lightbox.
Inside the JS there is line called innerhtml.
I found it to be working very good for placing html content in the JS file.

I can make clickable links inside the lightbox frame but here is the problem.
I want to make a next button that has to load it’s own URL but with this included ?offset=30.

so the lightbox loads a php script, and inside the frame of the lightbox i want a next button that actually loads the same php file but with that offset loaded behind that.
Something like this ?

object.innerHTML = ‘<a href=”thisurl” + ?offset=30>next</a>’

Is this possible ?

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@madmegaauthorMar 15.2010 — I know have this, it's a start but it still does not show the full URL

[code=php] object.innerHTML = '<a href="' + '?offset=15' + '">next</a>';[/code]
Copy linkTweet thisAlerts:
@KorMar 15.2010 — Hi, i am experimenting with a lightbox.
[/quote]

What kind of [I]lightbox[/I]? Shall we understand that you are using a javascript library/framework?

Inside the JS there is [COLOR="Red"]line called innerhtml[/COLOR].
[/quote]

a [I]what[/I]? Can you describe your problem in proper coding terms, please?
Copy linkTweet thisAlerts:
@madmegaauthorMar 15.2010 — Okay i will try again.

The lightbox i am loading is called lytebox.

It can load html pages inside a lightbox.

Right now it is loading a html file that is called hollow2.php

It shows perfectly, you can the html file hollow2.php

In the frame of the lytebox there is a close button.

Next to it, i made a link.

I made this link inside a JS file, that is loaded everytime the website is loaded.

There is a line inside that JS file that has the following code

[code=php]object.innerHTML = '<a href="' + '?offset=15' + '">next</a>'; [/code]

When i click the link, in the border of the lytebox it shows.

http://www.myurl.com/?offset=15

but what i would want is that it shows

http://www.myurl.com/hollow2.php?offset=15
Copy linkTweet thisAlerts:
@madmegaauthorMar 15.2010 — Now it only loads the main URL and the not the URL with the actual php/html file that is opened in the lytebox, is there a way to fix this ?
×

Success!

Help @madmega 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.5,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...