/    Sign up×
Community /Pin to ProfileBookmark

Javascript – Insert Strong Before (<!DOC) Prologue

Hi There,

I want to insert a block of PHP code before the <!DOC header, but without having to add anymore code.

How can this be done??

Thanks

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@KravvitzOct 22.2007 — Welcome to WebDeveloper.com Forums, mat11. ?

I doubt JavaScript can be used for what you want to do.

Could you give us more details?
Copy linkTweet thisAlerts:
@mat11authorOct 22.2007 — Thanks for the warm welcome Kravvitz!

Basically I'm building some generic pieces of code for developing websites and managing databases, however I need to insert an include and specified variable into the header of the page (a different page to the one with the javascript on) - similar to a Dreamweaver Extension - I can insert into the HEAD tag, but can't find a way to reference 'at the start of the file' or 'before the prologue'...

?

I know it can be done, but I'm not an advanced javascripter...and help greatly appreciated.
Copy linkTweet thisAlerts:
@FangOct 22.2007 — Any content added before the DTD would place IE in quirks mode, which would only add problems.

It is still unclear what needs to be inserted and what it's function is?
Copy linkTweet thisAlerts:
@mat11authorOct 22.2007 — <?php

$redirectURL = "";

include($sroot."/includes/newsletter.php");

?>

This is what needs to be inserted - it is literally a Dreamweaver Extension, so the text field 'redirectURL' is inserted for the variable, then the lines above need to be added before the DOC tag, as Dreamweaver does with recordsets etc...
Copy linkTweet thisAlerts:
@FangOct 22.2007 — I want to insert a block of PHP code before the <!DOC header, but without having to add anymore code.[/QUOTE]This is contradictory; somewhere more code has to be added.
Copy linkTweet thisAlerts:
@mat11authorOct 22.2007 — The other files needed have already been written and saved - these are saved to the relevant folder as and when needed.

It is only the header information I want to add in to the main file, but don't want to have to manually add in <span> tags or whatever in order for the JScript to find it.
×

Success!

Help @mat11 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 6.16,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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