|
Don't repost questions[^], In Q/A section some people made comments to your question. Read that again.
thatrajaCode converters | Education Needed
No thanks, I am all stocked up. - Luc Pattyn
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is - Henry Minute
|
|
|
|
|
Is there a question or are you looking to hire someone?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
How to do the method compute() ?
|
|
|
|
|
What do you mean?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Are you sure this is a Javascript question?
|
|
|
|
|
Good Day All
i am opening a Popup and i want to bind the "onbeforeunload" to the popup that if someone clicks on the close button in the window or close button in the page , the event should fire a javascript function that is on the page that opened the popup.
function ProcessPayment(Downloadurl)
{
var url = "http://XXXX.com/cccc_ccccc/2938dc870cd394?tc_id=210&tc_45f=50.0&sig=fc5cbfe44230";
var popupWindow = window;
popupWindow.onbeforeunload = function () {
if (Downloadurl != "") {
$.fileDownload(Downloadurl)
.done(function () { alert('File download a success!'); })
.fail(function () { alert('File download failed!'); });
}
else {
alert("No URL found");
}
}
popupWindow.open(url, 'popUpWindow', 'height=400,width=500,left=10,top=10,resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=yes')
when i try this nothing happens the event does not get work and no error in the browsers console
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
Please do not use pop ups!
Popups are a very ugly way of shoving some data into the users face, in a way he probably doesn't like and didn't ask for. The only thing that should open a new window or tab is me middle-clicking (or right-clicking) a link. Everything else should stay in the existing window.
|
|
|
|
|
hi Nicholas
I am building a mobile app using cross-platform mobile development toolkit, so this is something that gets popup when a third-party payment is required.
thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
Our app uses popups all the time. It works like Microsoft CRM. When you double-click a grid record we open the record maintenance in a popup.
Popups have their place but they did get a bad name because of people misusing them.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
|
hi Kornfeld
let me have a look at the link you sent.
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
I'm pretty sure that event has to be in the window itself, you can't attach your own. I could be wrong though.
Also, popupWindow.open() can be done modally so you can get the return value from it. If the return value is null, depending on the window, that could be the indication you are looking for.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
|
Hi
I am new user I want to open file on network drive like \\10.30.50.88\project\test\product\Daily\Reports\form.html and try to save on \\10.30.50.88\project\test\product\Daily\Reports\data.txt
But when Click on submit button it show error message
Error: Number:-2146827859 Description:Automation server can't create object
Please help me out . I want to replace “d:\\data.txt “ with “\\10.30.50.88\project\test\product\Daily\Reports\data.txt “
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Name</title>
<SCRIPT LANGUAGE='JavaScript'>
function WriteToFile() {
try {
var fso, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
s = fso.OpenTextFile("d:\\data.txt" , 8, true, 0);
s.writeline(document.ietmdata.name.value + ", " + document.ietmdata.email.value + ", " + document.ietmdata.location.value + ", " + document.ietmdata.type.value );
s.Close();
}
catch(err){
var strErr = 'Error:';
strErr += '\nNumber:' + err.number;
strErr += '\nDescription:' + err.description;
document.write(strErr);
}}
</SCRIPT> </head>
<BODY>
<form action="test.hta" method="post" name="ietmdata" >
Name: input type = "text" name="name"<br>
Email: input type="text" name="email"<br>
Location: input type = "text" name="location"<br>
Type: <select name="type" >
<option value="Software"> Software </option>
<option value="Hardware"> Hardware </option>
</select>
<br><br>
<INPUT TYPE=BUTTON VALUE="Submit Data to Text File" önClick="WriteToFile(this.form)">
</form>
</body></html>
|
|
|
|
|
DO NOT repost the same question!
You have already posted this question twice in QA and once in this forum. The first QA post even has an accepted answer.
Reposting the same question will not make the unpaid volunteers who help out on this site more likely to answer it. If anything, it will encourage us to ignore your question.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I am using kendoui un MVC.
Datepicker has watermark, if date is blank val()='' works fine in FF and Chrome but not in IE11.
In IE11 it shows the watermark value
any suggestion how to overcome this issue?
|
|
|
|
|
I can't see any watermark in IE11 - can you show your code?
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
it was something like this
var fromDate = $("#start").val().trim();
now i am using regex and it is working fine
fromDate.match(/^([1-9]|1[012])[- /.]([1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d$/))
|
|
|
|
|
What does following script do:
(function() { var b=window,f="chrome",g="jstiming",k="tick";(function(){function d(a){this.t={};this.tick=function(a,d,c){var e=void 0!=c?c:(new Date).getTime();this.t[a]=[e,d];if(void 0==c)try{b.console.timeStamp("CSI/"+a)}catch(h){}};this[k]("start",null,a)}var a;b.performance&&(a=b.performance.timing);var n=a?new d(a.responseStart):new d;b.jstiming={Timer:d,load:n};if(a){var c=a.navigationStart,h=a.responseStart;0<c&&h>=c&&(b[g].srt=h-c)}if(a){var e=b[g].load;0<c&&h>=c&&(e[k]("_wtsrt",void 0,c),e[k]("wtsrt_","_wtsrt",h),e[k]("tbsd_","wtsrt_"))}try{a=null,
b[f]&&b[f].csi&&(a=Math.floor(b[f].csi().pageT),e&&0<c&&(e[k]("_tbnd",void 0,b[f].csi().startE),e[k]("tbnd_","_tbnd",c))),null==a&&b.gtbExternal&&(a=b.gtbExternal.pageT()),null==a&&b.external&&(a=b.external.pageT,e&&0<c&&(e[k]("_tbnd",void 0,b.external.startE),e[k]("tbnd_","_tbnd",c))),a&&(b[g].pt=a)}catch(p){}})();b.tickAboveFold=function(d){var a=0;if(d.offsetParent){do a+=d.offsetTop;while(d=d.offsetParent)}d=a;750>=d&&b[g].load[k]("aft")};var l=!1;function m(){l||(l=!0,b[g].load[k]("firstScrollTime"))}b.addEventListener?b.addEventListener("scroll",m,!1):b.attachEvent("onscroll",m);
})();
I found it embedded in a page which looks harmless...
[Edit]I guess it is the same type of hack which I experienced 1.5 years agon on my web site, but the hacker added some more obfuscation now. See Analysing an obfuscated malware script[^].[/Edit]
modified 24-Feb-14 4:24am.
|
|
|
|
|
It's not obfuscated, but minified and it looks like a timing function, based on Google's library...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Thanks for your analysis. I hardly ever use JavaScript, so I rely mainly on context and experience. "minify" and "obfuscate" cause the same impression...
|
|
|
|
|
minifying is just to decrease the size of the script and thus decreasing the time needed for loading it from the server
obfuscating the code is done to protect the code to some degree from beeing copied by others. You can't compile javascript into a binary form that prevents doing so (you can't compile any .Net applications in that regard neither) so in those cases obfuscation makes it harder to understand the code.
A small sample (consider this as a piece of pseudo code)
function foo() {
var counter = 0;
bar(counter);
}
function bar(var myParam) {
var somethingElse = myParam;
}
and obfuscate it to
function a() {
var b=0;
a(b);
}
function a(var b) {
var c=b;
}
you don't really know what those function really do without having the full context of it, thus making it a lot harder to just copy a function out of the script "stealing" someone else's hard work.
So nothing shady about those (of course you could assume that malicious scripts will usually be obfuscated and minified to prevent user from easily detect what they are doing)
|
|
|
|
|
Thanks for this explanation. It was the context (faked entry in a log file) paired with past experience and the unreadability of that script which made me assume malware.
Though minifying scripts may be legitimate to decrease the still increasing enormous volumes of JavaScripts sent over the network with still decreasing "payload" of actual content, it makes distinguishing those scripts from intentiously obfuscated malware scripts extremely hard - thus actually causing security issues.
|
|
|
|
|
Don't know a lot about Javascript, but there seem to be multiple syntax errors in your script.
|
|
|
|
|
Where?
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|