Correct usage of VBScript's MsgBox - vbscript

I require to display some text in the browser with some words in between as links. On click of the links I want to display a pop up dialog with just some text and an OK button.
I want the title of the Pop up dialog to be changeable via code and also the icon to be the information icon. I use a JavaScript alert box which always has a heading of pop up as "Message from web page".
I think it can done using VBScript. What is the correct usage of VBScript? PFB the sample using JavaScript, I need this to be tweaked, so that VBScript is used and MsgBox is used.
<html>
<head>
<script type="text/javascript">
fucntion(test){
alert(test)
}
</script>
</head>
<body>
This is my link which
you can click on for definition.
</body>
</html>

This works fine. 64 is for the information icon and OK button. But I not able to get rid of "vbscript:" which is present at the start of the title. I am not sure why it is like that.
<html>
<head>
<script type="text/vbscript">
Function myPopUp(test)
MsgBox test, 64, "My Custom Title"
End Function
</script>
</head>
<body>
This is my <a href="#" language="vbscript" onclick="myPopUp('How are you do
today')">link</a> which
you can click on for definition.
</body>
</html>

Related

jQuery Datepicker in Fancybox not working

I have a very strange behavior with a datepicker loaded with data-type="ajax" inside the fancybox.
It is not possible to change month and year in the datepicker.
If I open datepicker and close the fancybox not by using the close "x", the datepicker still remains, but then with working select boxes for month and year
Here's my code from the calling script:
<html>
<head>
<title>test fancybox with datepicker</title>
<script language="javascript" type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.2.5/jquery.fancybox.min.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.2.5/jquery.fancybox.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.css" />
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script></head>
<body>
<a data-fancybox data-type="ajax" href="testfancy-call.php">
Load Fancybox Content
</a>
</body>
</html>
And this is the very simple code from testfancy-call.php:
<html>
<head>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$("#date").datepicker({
changeMonth: true,
changeYear: true,
});
});
</script>
</head>
<body>
<h1>Datepicker</h1>
<input type="text" name="date" value="" id="date">
</body>
</html>
I tried to use data-type="iframe". Here I get the datepicker working, but I have to include all external script inside "testfancy-call.php". This is not a proper solution for me, because the used software's architecture doesn't allow this. So I need to find a way using data-type="ajax".
EDIT
The behavior is only when loading with data-type="ajax". If I place the code stuff from the ajax-loaded file testfancy-call.php directly inside the calling script like in https://codepen.io/fancyapps/pen/QqLXaz it works!
EDIT 2
After some research I found that it's a crossbrowser problem for issue 1. In Firefox the selectboxes for month and year so not work. Internet Explorer and Chrome work like exspected. Is there a way to get Firefox working?
All three testet browsers have the problem that is described in issue 2.
EDIT 3
I've uploaded a demo: http://marcox.square7.ch/testfancy.html
Try disabling touch events using touch: false, because fancyBox catches touch events by default to enable swiping gestures.

Script to display a picture burst on Windows

I have a Windows command that gets a png picture. I need to create a script that executes it and displays the last picture obtained, giving a live video effect. My main problem is that I don't know how to display the picture burst.
Moreover, as it is going to be used for some kind of video streaming, every past picture will be deleted. I'll have to use this script in a web page with a "start/stop" button to start/stop the streaming.
Would you recommend me using a Windows bat script or any other scripting language? How can I display the picture burst?
You can run an .HTA file and put whatever functionality you want:
<HTA:Application
Caption = No
ShowInTaskbar = No
BorderStyle=Static
SysMenu=No
WindowsState=Maximize
Border=Thin
MaximizeButton=No
MinimizeButton= No
>
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<html>
<body>
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg/402px-Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg" width="277" height="413">
<script language="javascript" type="text/javascript">
window.visible=true;
window.resizeTo(320,480);
</script>
</body>
</html>

CKEditor inline editing - content isnt editable?

I downloaded the latest CKEditor and tried the following:
<html>
<head>
<script src="ckeditor/ckeditor.js">
</script>
</head>
<body>
<div id="editor">
Some test text
</div>
<script>
CKEDITOR.disableAutoInline = true;
var editor = CKEDITOR.inline( 'editor' );
</script>
</body>
It worked in the sense that I can click the div to make the editor toolbar appear, but aside from that I can't seem to edit the content! Most of the toolbar buttons are disabled, and typing into the field does nothing. (See screenshot below)
According to http://nightly.ckeditor.com/13-04-14-07-42/standard/samples/inlinebycode.html this should be all the JS I need. Is there some other config setting I need to be doing?
Rawr, sorry. I found the answer mere minutes after posting this. I was so focused on looking for a config option I didn't realize to check the div in the example.
The div still has to have contenteditable="true" even if I don't use CKEDITOR.disableAutoInline.

MVC jqueryUI modal dialog

So in all my failed attempts to get jQueryUI working, I have tried this example here after downloading a theme from the jQueryUI site.
and here is my code looking at that example in the link above in my asp.net mvc page.
<link type="text/css" href="<%= Url.Content("~/Scripts/jquery-ui/css/smoothness/jquery-ui-1.8.17.custom.css")%>" rel="stylesheet" />
<script type="text/javascript" src="<%= Url.Content("~/Scripts/jquery-ui/js/jquery-1.7.1.min.js")%>"></script>
<script type="text/javascript" src="<%= Url.Content("~/Scripts/jquery-ui/js/jquery-ui-1.8.17.custom.min.js")%>"></script>
<script>
$('#dialog_link').click(function(){
$('#Dialog').dialog('open');
return false;
});
</script>
<p id="dialog_link">Open Dialog</p>
<div id="Dialog" title="Dialog title!">
This content shown within dialog...
</div>
After hitting F5 I would have expected to see a clickable text which when clicked would bring up a modal dialog with a [x] button to close it and get back to the main window. However what I get to see is this on page load,
where the text 'open dialog' does not respond to click events and the supposed "modal dialog" is already visible in the form of a plain string and without any formatting. So where did all the magic of jQueryUI go? Something wrong in my linking correct scripts?
Totally lost. Please help..
Edit
This exact same code works in pure html mode in a different file. when I copy this code into my asp.net mvc page within the content tags I get a javascript error at a non-descript line!!
Just take the 'open' out of your $('#Dialog').dialog('open'); and you are good to go.
Edit: Added this jsFiddle with your code as an example:
http://jsfiddle.net/DoomHamster/LhJsL/1/
Also, you don't need 'return false' when clicking an element with no default click event.
EDIT: From your comment below I suspect that you are having issues with loading jQuery and jQueryUI in the first place. Try replacing your script and css links with the following as a test to eliminate path issues:
<link type="text/css" rel="Stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/themes/ui-lightness/jquery-ui.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/jquery-ui.min.js"></script>
Try this
$(function()
{
$('#dialog_link').click(function(){
$('#Dialog').dialog();
return false;
});
})

How can I set element.onmouseover?

I am new to VBScript. I want to change the image source on mouseover but I am unable to that.
My code is as follows:
<head>
<script language="vbscript">
'code.....(please use Sub as sub and Img1 as img1)
Sub img1_OnClick
Img1.src="imge1.jpeg"
End sub
'code ends....
</script>
</head>
<body>
<img name="img1" src="imge.jpeg" />
</body>
</html>
This code is not working. Can anyone suggest something better?
You seem to be using OnClick, which sounds like the wrong event, I'd suggest looking at the OnMouseOver event and possibly also the OnMouseOut event instead.

Resources