/    Sign up×
Community /Pin to ProfileBookmark

Can I write a variable with an onClick??

Hi there everyone, I’ve got a problem with a variable im trying to write and i cant figure out how to add onclick to it or even add an href. What i have is basically this…..

var output = “”;
if ((navigator.appName == “Microsoft Internet Explorer”) &&
(navigator.platform != “MacPPC”) && (navigator.platform != “Mac68k”))
{
// If Internet Explorer under Windows then use ActiveX
output = ‘<OBJECT ID=”Player” onclick = “video()” width=”‘
output += DisplayWidth;
output += ‘” height=”‘;
output += DisplayHeight;
output += ‘” CLASSID=”CLSID?E625294-70E6-45ED-B895-CFFA13AEB044″ ‘;
output += ‘CODEBASE=”‘;
output += BaseURL;
output += ‘activex/AMC.cab#version=4,1,5,3″>’;
output += ‘<PARAM NAME=”MediaURL” VALUE=”‘;
output += BaseURL;
output += File + ‘”>’;
output += ‘<param name=”MediaType” value=”mjpeg-unicast”>’;
output += ‘<param name=”ShowStatusBar” value=”0″>’;
output += ‘<param name=”ShowToolbar” value=”0″>’;
output += ‘<param name=”AutoStart” value=”1″>’;
output += ‘<param name=”StretchToFit” value=”1″>’;
// Remove the // for the ptz settings below to use the code for click-in-image.
// output += ‘<param name=”PTZControlURL” value=”‘;
// output += BaseURL;
// output += ‘/axis-cgi/com/ptz.cgi?camera=1″>’;
// output += ‘<param name=”UIMode” value=”ptz-relative”>’; // or “ptz-absolute”
output += ‘<BR><B>Axis Media Control</B><BR>’;
output += ‘The AXIS Media Control, which enables you ‘;
output += ‘to view live image streams in Microsoft Internet’;
output += ‘ Explorer, could not be registered on your computer.’;
output += ‘<BR></OBJECT>’;
} else {
// If not IE for Windows use the browser itself to display
theDate = new Date();
output = ‘<IMG SRC=”‘;
output += BaseURL;
output += File;
output += ‘&dummy=’ + theDate.getTime().toString(10);
output += ‘” HEIGHT=”‘;
output += DisplayHeight;
output += ‘” WIDTH=”‘;
output += DisplayWidth;
output += ‘” onclick=”video()” ALT=”Camera Image”>’;
}
document.write(output);
document.Player.ToolbarConfiguration = “play,+snapshot,+fullscreen”;

…and I can’t get the two onclick functions to work. I’ve tried a buttload of different ways to do this and every time its either an error on page or “done’ but not working. I desperately need this to work so if anyone has any ideas??? Thanks

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @Nimrod5000 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.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

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