[Solved] How can i open a link in a new window in IE8? [closed]

You can do it with popups <script language=”javascript” type=”text/javascript”> function popitup(url) { newwindow=window.open(url,’name’,’height=200,width=150′); if (window.focus) {newwindow.focus()} return false; } Then, you link to it by: <a href=”https://stackoverflow.com/questions/9221563/popupex.html” onclick=”return popitup(“https://stackoverflow.com/questions/9221563/popupex.html”)”>Link to popup</a> solved How can i open a link in a new window in IE8? [closed]

[Solved] HTML Input (Javascript) [closed]

I have created a JSFiddle to demonstrate this. When you type in the email and then leave the input box, it shortens. When you re-enter the input box it expands back to its full length… $(‘#email’).bind(‘change’, function () { $self = $(this); var fullEmail = $self.val(); var shortEmail = fullEmail; if(fullEmail.length > 15) { shortEmail … Read more

[Solved] Auto refresh PHP script backend [closed]

To refresh a page without reloading, you have to load the contents of the page through ajax. You could do this as follows: index.php <html> <head> <script type=”text/javascript”> $(document).on(‘ready’, function(){ setInterval(function() { $.ajax({ type: “GET”, url: “ajax_refresh.php”, success: function(result) { $(‘body’).html($result); } }); }, 3000); }); </script> </head> <body> <div class=”header”> Header of website here … Read more

[Solved] Have image open in its own page with information [closed]

Something like this ? info could be moved around , styled as per needs. .info{display:none} img:hover +.info{display:inline;} <img src=”http://lorempixel.com/150/150″width=”150″ height=”150″ /> <span class=”info”>This pic is super</span> <img src=”http://lorempixel.com/150/150″width=”150″ height=”150″ /> <span class=”info”>This pic is super</span> <img src=”http://lorempixel.com/150/150″width=”150″ height=”150″ /> <span class=”info”>This pic is super</span> <img src=”http://lorempixel.com/150/150″width=”150″ height=”150″ /> <span class=”info”>This pic is super</span><img src=”http://lorempixel.com/150/150″width=”150″ height=”150″ … Read more

[Solved] Javascript: How do I change every word visible on screen? [closed]

Recursively walk the nodes and do a regex replace. Quick and dirty example: function replaceAllWords(newWord) { for (var i = 0; i < document.childNodes.length; i++) { checkNode(document.childNodes[i]); } function checkNode(node) { var nodeName = node.nodeName.toLowerCase(); if(nodeName === ‘script’ || nodeName === ‘style’) {return;} if (node.nodeType === 3) { var text = node.nodeValue; var newText = … Read more

[Solved] How does Node.JS work as opposed to PHP?

You don’t necessarily need to use response.write for each line of the view, you can use template engines as well. Search for “node.js template engines”. At first impression it could seem tedious, but a similar approach prevents you from writing bad code. solved How does Node.JS work as opposed to PHP?

[Solved] Uncaught ReferenceError: emptyimage is not defined

Your error is here : onerror=”this.onerror=null;this.src=”https://stackoverflow.com/questions/25486756/+defaultimage+”” After the interpretation, it look like this : onerror=”this.onerror=null;this.src=images/emptyimage.jpg” You need to wrap your variable to make it a string once the javascript interpreted : onerror=”this.onerror=null;this.src=\'”https://stackoverflow.com/questions/25486756/+defaultimage+”\'” 0 solved Uncaught ReferenceError: emptyimage is not defined

[Solved] dynamically creating an associative array

This should do the trick: var hash_a = {‘foo’: ‘bar’}; var hash_b = {‘alha’: ‘beta’}; var array = [‘a’, ‘b’, ‘c’]; function build(a,b,c){ var o=c.reduceRight(function(o, n){ var b={}; b[n]=o; return b; }, b); for(x in a){ o[x]=a[x]; } return o; } Here is the fiddle to play with. See MDN for further explanation of Array.prototype.reduceRight(). … Read more

[Solved] Unexpected token error in JS function

You shouldn’t terminate the first line with a ; var goSleep=function();// goSleep Function // ——————-^ Remove this!!! { var count=0; var loop=false; while(count<3) //while loop { console.log(“hi!”); count++; loop=false; } for(i=0;i<4;i++) //for loop { console.log(i); } var login=false; do{//do while loop console.log(“gud day”); }while(login); }; goSleep(); Change your code to: var goSleep=function() // goSleep Function … Read more

[Solved] How to get 12am 7 days ago? [duplicate]

You can go back seven days, then just use Date#setHours() to adjust the time portion: var date = new Date(“2020-12-02T16:53:12.215”); //assume a stable time //go seven days back date.setDate(date.getDate() – 7); //set the time to 12:00:00.000 date.setHours(12, 0, 0 , 0); console.log(date.toString()); //human-readable console.log(date.getTime()); //Unix timeastamp in milliseconds console.log(date.getTime() / 1000); //regula Unix timeastamp in … Read more

[Solved] How to pass data from child to parent component in vue?

You can use $emit method for this purpose. v-on directive captures the child components events that is emitted by $emit Child component triggers clicked event: export default { methods: { onClickButton (event) { this.$emit(‘clicked’, ‘someValue’) } } } Parent component receive clicked event: <div> <child @clicked=”onClickChild”></child> </div> export default { methods: { onClickChild (value) { … Read more