|
What have you tried can you add your code here?
modified 20-Sep-20 21:01pm.
|
|
|
|
|
Hi,
I want to convert canvas image to webm video in Mozilla Firefox.
In Chrome, it is easy to use RecordRTC.js.
But Mozilla Firefox doesn't support image/webp format.
How can I convert image to video in Mozilla Firefox?
Please, help.
|
|
|
|
|
You really can't depend upon a browser to do your work for you.
You need to get it on the web server, convert it, store it, and point to it using the proper HTML element.
|
|
|
|
|
I am new to javascript and have to maintain an old application. I would like to know if there is a way I can make this scroller display more than one message at a time.
Thanks.
There is an array messages[] that holds all the messages.
var ie=document.all
var dom=document.getElementById
if (messages.length>2)
i=2
else
i=0
function move1(whichlayer){
tlayer=eval(whichlayer)
if (tlayer.top>0&&tlayer.top<=5){
tlayer.top=0
setTimeout("move1(tlayer)",scrollerdelay)
setTimeout("move2(document.main.document.second)",scrollerdelay)
return
}
if (tlayer.top>=tlayer.document.height*-1){
tlayer.top-=5
setTimeout("move1(tlayer)",50)
}
else{
tlayer.top=parseInt(scrollerheight)
tlayer.document.write(messages[i])
tlayer.document.close()
if (i==messages.length-1)
i=0
else
i++
}
}
function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.top>0&&tlayer2.top<=5){
tlayer2.top=0
setTimeout("move2(tlayer2)",scrollerdelay)
setTimeout("move1(document.main.document.first)",scrollerdelay)
return
}
if (tlayer2.top>=tlayer2.document.height*-1){
tlayer2.top-=5
setTimeout("move2(tlayer2)",50)
}
else{
tlayer2.top=parseInt(scrollerheight)
tlayer2.document.write(messages[i])
tlayer2.document.close()
if (i==messages.length-1)
i=0
else
i++
}
}
function move3(whichdiv){
tdiv=eval(whichdiv)
if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5){
tdiv.style.top=0+"px"
setTimeout("move3(tdiv)",scrollerdelay)
setTimeout("move4(second2_obj)",scrollerdelay)
return
}
if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1){
tdiv.style.top=parseInt(tdiv.style.top)-5+"px"
setTimeout("move3(tdiv)",50)
}
else{
tdiv.style.top=parseInt(scrollerheight)
tdiv.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}
function move4(whichdiv){
tdiv2=eval(whichdiv)
if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style.top)<=5){
tdiv2.style.top=0+"px"
setTimeout("move4(tdiv2)",scrollerdelay)
setTimeout("move3(first2_obj)",scrollerdelay)
return
}
if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1){
tdiv2.style.top=parseInt(tdiv2.style.top)-5+"px"
setTimeout("move4(second2_obj)",50)
}
else{
tdiv2.style.top=parseInt(scrollerheight)
tdiv2.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}
function startscroll(){
if (ie||dom){
first2_obj=ie? first2 : document.getElementById("first2")
second2_obj=ie? second2 : document.getElementById("second2")
move3(first2_obj)
second2_obj.style.top=scrollerheight
second2_obj.style.visibility='visible'
}
else if (document.layers){
document.main.visibility='show'
move1(document.main.document.first)
document.main.document.second.top=parseInt(scrollerheight)+5
document.main.document.second.visibility='show'
}
}
window.onload=startscroll
</script>
<ilayer id="main" width=&{scrollerwidth}; height=&{scrollerheight}; bgColor=&{scrollerbgcolor}; background={scrollerbackground}; visibility=hide>
<layer id="first" left=0 top=1 width=&{scrollerwidth};>
<script language="JavaScript1.2">
if (document.layers)
document.write(messages[0])
</script>
</layer>
<layer id="second" left=0 top=0 width=&{scrollerwidth}; visibility=hide>
<script language="JavaScript1.2">
if (document.layers)
document.write(messages[dyndetermine=(messages.length==1)? 0 : 1])
</script>
</layer>
</ilayer>
<script language="JavaScript1.2">
if (ie||dom){
document.writeln('<div id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hidden;background-color:'+scrollerbgcolor+' ;background-image:url('+scrollerbackground+')">')
document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0px;top:0px">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:1px;">')
document.write(messages[0])
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px;visibility:hidden">')
document.write(messages[dyndetermine=(messages.length==1)? 0 : 1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</div>')
}
</script>
modified 24-Jun-15 14:21pm.
|
|
|
|
|
Hi,
I'm going to record remote audio in video chating with WebRTC.
But webrtc provide audio in mono mode, and chrome supports recording only stereo mode.
So, I need to convert audio channel from mono to stereo mode.
Is it possible?
If it possible, how can I do it?
Thanks.
modified 19-Jun-15 4:01am.
|
|
|
|
|
In JavaScript
I need the shortest possible code to generate the 99 bottles of beer on the wall song lyrics into a string (using "\n" as the line separator). The problem is making it grammatically correct while still keeping the code compact.
For a refresher:
99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 98 bottles of beer on the wall.
98 bottles of beer on the wall, 98 bottles of beer.
Take one down and pass it around, 97 bottles of beer on the wall.
97 bottles of beer on the wall, 97 bottles of beer.
Take one down and pass it around, 96 bottles of beer on the wall.
...
2 bottles of beer on the wall, 2 bottles of beer.
Take one down and pass it around, 1 bottle of beer on the wall.
1 bottle of beer on the wall, 1 bottle of beer.
Take one down and pass it around, no more bottles of beer on the wall.
I'm searching for the cleverest, most compact approach.
Any ideas?
|
|
|
|
|
It's your homework; you do it. Or maybe you could search for a website with that problem already written in many languages...
|
|
|
|
|
Course I can do it, I just want to see some new, clever approaches.
What, does nobody code for fun anymore? Here, i'll post mine.
|
|
|
|
|
Here's the one I made. 194 characters long. This is my first time code golfing, but I think i'm getting the hang of it.
for(var $=b=c=d='',_=99,a=' on the wall.';b=' bottle'+(~(_-2)?'s':d)+' of beer',_>~0;c=_--&&'\n\n') 99-_&&($+='.\nTake one down and pass it around, '+(_||'no more')+b+a),$+=_?c+_+b+a+', '+_+b:d;
console.log($);
modified 16-Jun-15 23:53pm.
|
|
|
|
|
|
|
How to bind image in jquery. am unable to bind image when i wrote the below code plz help me
jQuery(document).ready(function () {
$("#uploadEditorImage").change(function () {
var data = new FormData();
var files = $("#uploadEditorImage").get(0).files;
if (files.length > 0) {
data.append("HelpSectionImages", files[0]);
}
$.ajax({
url: "../Account/UploadFile/",
type: "POST",
processData: false,
contentType: false,
data: data,
success: function (response) {
jQuery("#selimgs_", top.document).attr('src', response);
},
error: function (er) {
}
});
});
});
|
|
|
|
|
Hi,
I have almost developed a website using Dot net, C#, Jquery, Javascript etc. Now, for having chat among visitors, we picked the AJAX code from https://code.msdn.microsoft.com/CSASPNETAJAXWebChat-c4c9b8fe and customized it...
When we see the demo in there, it successfully shows the chatboxes and implements the chats well... But we couldn't able to integrate it with our already built web application (Web forms and not MVC). Since we get no errors, its very hard to predict the issue clearly. Do I have to make some changes in web.config?
Getting a warning alone which is
Warning 1 The 'contract' attribute is invalid - The value 'PlayZone.Services.SessionPool' is invalid according to its datatype 'serviceContractType' - The Enumeration constraint failed. E:\Projects\PlayZoneJUNE04\PlayZone\Web.config 57 48 PlayZone
Actually, I took the code from MSDN and pasted it successfully. The problem seems to occur in the Web.Config's service region.
WEB.CONFIG's SERVICE
<services>
<service name="WebChat.Services.Transition">
<endpoint address="" behaviorConfiguration="Sever.Services.TransitionAspNetAjaxBehavior"
binding="webHttpBinding" contract="WebChat.Services.Transition" />
</service>
<service name="WebChat.Services.SessionPool">
<endpoint address="" behaviorConfiguration="Sever.Services.SessionPoolAspNetAjaxBehavior"
binding="webHttpBinding" contract="WebChat.Services.SessionPool" />
</service>
</services>
Here are the overall details
i) I downloaded Ajax based group chat, which was done following the procedures on the page https://code.msdn.microsoft.com/CSASPNETAJAXWebChat-c4c9b8fe#content.
ii) The sample alone as a separate site works fine... But when combined with my website code, it shows the warnings and the chat is not working.
iii) Our Dot net framework version is 4.5... but the web chat's framework on MSDN shows version 4 when run alone.
iv) Server - IIS (Local machine)
Hope this helps you to understand further. Thanks for your concern and have a nice day ahead.
|
|
|
|
|
And how all this related to JavaScript?
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
I am getting a finding in my scan indicating that my code is vulnerable to JavaScript hijacking. My code dynamically generate all of the page content, including the Ajax ScriptManager. Because the content is not in the webpage as static markup it is my opinion that this is a false finding. Can someone review my code and either confirm or deny my belief and if I am incorrect recommend a proper implementation.
private void CreateControls(ControlCollection cc)
{
if (RadScriptManager.GetCurrent(_contextPage) == null)
{
RadScriptManager rsm = new RadScriptManager();
rsm.ID = "scriptManager";
cc.Add(rsm);
}
}
<pre>
|
|
|
|
|
That code is not enough, and is also not very much explaining what it does (at least the section shared). You should try to make sure that your website is safe, and that, no network request is left and allowed to make your server run executions without your intention.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I have this line in a .js file.
var nameChanged = require('../../templates/namechanged.hbs')
I searched the entire website and could not find a file namechanged.hbs.
Is it not even a file? Where should I look for this?
There are strangers on the Plain, Croaker
|
|
|
|
|
|
Will do.
Thank you.
There are strangers on the Plain, Croaker
|
|
|
|
|
I found what I needed.
The reference to the 'path' in the require statement referred to the index of the handlebar template associated with the 'path' in an object.
~18K lines down in the file was a handlebar template with an index. It was that index that I needed to find to locate the templating code.
Again, thank you for the help.
There are strangers on the Plain, Croaker
|
|
|
|
|
webkitfullscreenchange, mozfullscreenchange, fullscreenchange is not firing or working when i used it on the iPad So any but have any other alternative then help on this.
|
|
|
|
|
Try using the older webkitbeginfullscreen and webkitendfullscreen events.
History of the Fullscreen API[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
thank it working perfectly....
|
|
|
|
|
So why did you down-vote my answer?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
i dont know i think by mistake i did that
|
|
|
|