Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Make A Document.write also have onclick or href
Old 04-10-2009, 08:34 PM Make A Document.write also have onclick or href
Novice Talker

Posts: 5
Name: kaeton
Trades: 0
Hi all, i got this script for a video and i can't for the life on me figure out how to make it a link. Prefer to call a function on the video click so i can adjust the new window format. Heres what i need to link....


<td align="center" valign="middle" onfocus="MM_callJS('video()')"><SCRIPT LANGUAGE="JavaScript">
// Set the BaseURL to the URL of your camera
var BaseURL = "http://192.168.1.18/";
// DisplayWidth & DisplayHeight specifies the displayed width & height of the image.
// You may change these numbers, the effect will be a stretched or a shrunk image
var DisplayWidth = "480";
var DisplayHeight = "360";
// This is the path to the image generating file inside the camera itself
var File = "axis-cgi/mjpg/video.cgi?resolution=480x360&compression=10&color= 1&clock=0&date=0&text=0";
// No changes required below this point
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" width='
output += DisplayWidth;
output += ' height=';
output += DisplayHeight;
output += ' CLASSID="CLSIDE625294-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 += '" ALT="Camera Image">';
}
document.write(output);
document.Player.ToolbarConfiguration = "play,+snapshot,+fullscreen";
// Remove the // below to use the code for Motion Detection.
// document.Player.UIMode = "MDConfig";
// document.Player.MotionConfigURL = "/axis-cgi/operator/param.cgi?ImageSource=0"
// document.Player.MotionDataURL = "/axis-cgi/motion/motiondata.cgi";
</SCRIPT></td>


Any help would be freakin sweet, thanks guys.
kaeton is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-11-2009, 07:45 PM Re: Make A Document.write also have onclick or href
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
output +='"onclick = 'function(args)'"

Do yourself a big favor learn php and give up activex and vbscript, even if you are doing intranets!
__________________
Sleeping Troll, EMUSE, Mind Expansion...Truly serendipity!
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
Old 04-13-2009, 12:52 AM Re: Make A Document.write also have onclick or href
Novice Talker

Posts: 5
Name: kaeton
Trades: 0
Thanks alot for your reply but i tried this with no luck any other advice?? maybe i wrote it in wrong? I wrote it in after the if and i wrote this command...

output += 'onclick = "video()"';
where the function is this....

function video(){
window.open('../desktop/212 PERFECT.html','Camera1','width=894,Height=488,resi zable=no,Scrollbars=no,directories=no,status=no,me nubar=no')
}
kaeton is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Make A Document.write also have onclick or href
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.49520 seconds with 12 queries