293 Posted Topics
Re: 'value' property is read-only. But there a work around you can use: [code=html] <html> <head> </head> <script> function fileselectedchange(obj) { var fName = obj.value; var fileEXT = fName.substring(fName.indexOf('.') + 1, fName.length); if (fileEXT.toUpperCase() != 'XLS'){ // Reset the innerHTML with the initial one document.getElementById('input1').innerHTML = divInnerHTML; return false; } } … | |
Re: use <table> to position input and button [code=html] <table> <tr> <td style="text-align: left;"><input type='text'></input></tb> <td style="text-align: right;"><input type='submit'></input></tb> </tr> </table> [/code] | |
Re: It seems that line 11 would give error as JQuery id selector returns single element not array. [code=javascript] $("#player").play(); [/code] Also check by hard coding the path of audio file in above function(that is without using id) | |
Re: Use setInterval() method instead of setTimeout(). setInterval will repeatedly call a function at given interval [code=javascript] setInterval("sendRequest()", 2000 ); [/code] | |
Re: You can not send ajax request to other server. Ajax only works on same domain server. I am not sure if it will work...But you must try this. You can create a proxy on your server to handle external php file. Something like this: [code=html] <!-- Proxy to handle external … | |
Re: [code=javascript] // Pass the string you want to search. It will return valid index if string found else it will return -1 function search(str) { var selEl = document.getElementById('myselect'); if(selEl) { var options = selEl.options; for(var i = 0; i < option.length; i++) { if(options[i].value == str) return i; } … | |
Re: As you may know split() returns array of strings. So you just need to split the tArea string with <selected> text which will return you an array of 2 strings: before and after strings of <selected> text. Hope this will help:- [code=html] <html> <script> function show(tArea) { var value = … | |
Re: are you looking for something like this : [code=javascript] document.form.seconds.value = "00:00:" + (myTime < 10 ? "0" + myTime : myTime); [/code] | |
Re: [QUOTE=new_developer;1501227]I checked that code but I it still not working.[/QUOTE] How you tested it. I just copy pasted the code and alerts hasNumber and it is working perfectly without any change. | |
Re: I think you are on right track. html, javascript, css are all client side technologies and are bit easy to grasp. And for these you just need a web-browser to practice. php and mysql on other hand can be learn side by side as both are used very closely. And … | |
Re: You have to handle click on div also. And in that click handler you need to stop event to get Propagating further. [code=javascript] document.getElementById("tip1").onclick = function(e){e.stopPropagation(); return false;}; [/code] | |
Re: We would need more information like where you are adding OnPageLoadAdd() handler. | |
Re: I think double quotes(") in JSON string is creating problem. You need to replace (") with (') in php function generate_banners(): [code=php] function generate_banners($user_id) { $html = ''; $query = $this->db->where('user_id',$user_id)->select('filename')->get('jos_reklama_banners'); if($query->num_rows() > 0) { foreach($query->row() as $filename) { $html .= '<div id = ''.$filename.''> <img src=''.base_url().'uploads/banners/'.$filename.'?'.time().'' /> </div>'; } … | |
Re: Two issues:- 1. The input type at line 55 should of type "submit" 2. onClick should return true/false to stop/start sending data to server. Line 55 should be [code=html] <INPUT TYPE="submit" NAME="Submit" Value="Submit" onClick="return readText(this.form)"/> [/code] | |
Re: Try this :D [code=javascript] <!-- Twitter Widget --> <div id="isolate"> <script src="http://widgets.twimg.com/j/2/widget.js"></script> </div> <br><br /><br /> <script type="text/JavaScript"> <!-- function changTwitter() { var currentTime = new Date().getHours(); if (7 <= currentTime&¤tTime < 17) { document.write("<script> new TWTR.Widget({ version: 2, type: 'search', search: '@BigNotch', interval: 6000, title: 'Follow Me On Twitter', … | |
Re: You just need to hide next element of <h3> also. Use 'nextSibling' property of elems[i] to get <blockquote> element. [code=javascript] function hideText(e) { var character = e.target || event.srcElement; var elems = document.getElementsByTagName("h3"); for (i = 0; i < elems.length; ++i) { if(character.value != elems[i].innerHTML) { elems[i].style.display = "none"; elems[i].nextSibling.style.display … | |
Re: Use zIndex property of container div to place it on top. Modified code: [code=javascript] function decreaseSizeImage(idname) // will get back to its normal default size { var id_name=idname; if(glbInc != null) {clearTimeout(glbInc); glbInc = null;}; if (document.getElementById(id_name).height > 100) { document.getElementById(id_name).height -= 30; document.getElementById(id_name).width -= 40; // Decrease the zindex … | |
Re: split() method can do it directly. check this function. | |
Re: I cannot put Ajax code here. But let me tell you its pretty simple. Ajax in simple words is method to send http request to server asynchronously(without blocking other activities). And you can get response back from server. Once you sent ajax request you start waiting for response from the … | |
Re: Showing data on same page and loading new html page is all different things. If you need to load data from database you will probably not need iframe. Ajax can do it easily. If you want to load new html page onto your current html page then you can only … | |
Here is simple C program for analog clock. Comipler: TurboC | |
Hi all, I want help from all you wonderful guys. I want to know how can we free memory occupied by an Array. That means all the elements associated with this array should be deleted. let say: [code='javascript'] var bigArray = ["313123", "123123", "sadasd",.........................]; [/code] So which will be the … | |
Hi to all, I want to know how to send data to MS-Excel sheet from HTML form with javascript. It should be done in javascript not java. Thanks | |
Re: In HTML for 'Cancel' button remove change the property type='submit' to type='button'. This will no cause to call 'checkForm()' method when 'Cancel' button is pressed. | |
Re: Why you want to do things that is not stable at all? If some how you achieved this, what if user press ctrl+ again. Then you will ask how to restrict this. You can not restrict user. They will some how break all your twiky walls. I would suggest you … | |
Re: Check this out: [url]http://www.w3schools.com/JS/js_cookies.asp[/url] After this you will be able to do what you want | |
| |
Re: This is because you are appending the new value always. You have to get the position of the carrot and do some string operation. here is a function to insert in between:- ([url]http://alexking.org/blog/2003/06/02/inserting-at-the-cursor-using-javascript[/url]) [code='javascript'] function insertAtCursor(myField, myValue) { //IE support if (document.selection) { myField.focus(); sel = document.selection.createRange(); sel.text = myValue; … | |
Re: Here is a sample(NOT complete):- Main page [CODE=html] <script> function loadXMLDoc(selectEl) { ... ... xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("display_city_div").innerHTML=xmlhttp.responseText; } } ... ... /* Get the selected city */ var selectedCity = selectEl.options[selectedIndex].text; /* Send it with url */ xmlhttp.open("GET",url+'?city=' + selectedCity ,true); } </script> <body> <h2>AJAX</h2> … | |
Re: I could not understand why you have defined more than 1 function with same name and same code? | |
Here is simple c++ program to demonstrate matrix rain. Compiler:TurboC | |
Re: First let me clear one thing: Of all the above only javascript is a scripting language. Other 2 are not even languages. What type of control/ease/trends are you talking about. | |
Re: First of all the output you gave (10101010) is not correct in fact according to your naked (uncommented) code the output should start with "0" as you have declared answer as string(No idea why). Put some clothes (comments) in your code. We can hardly make sense about this code. | |
Hi All, I am struggling to get the version of css supported in my browser. Is there any way to get it through javascript. Thanks | |
Re: Arranging your code: [CODE=javascript] function insCell() { var x=document.getElementById('tr2').insertCell(1); var y=document.getElementById('tr1').insertCell(1); y.innerHTML= 'Day 1'; x.innerHTML='<input type="text" name="day" onmouseover="onOver();" onmouseout="onOut();" onclick="onClick();"><img src="images/calendar.gif" name="imgCalendar" width="34" height="21" border="0" alt="">'; } function onOver() { if (timeoutId) clearTimeout(timeoutId); window.status='Show Calendar'; return true; } function onOut() { if (timeoutDelay) calendarTimeout(); window.status=''; return true; } function onClick() … | |
Re: C is very important for the beginners as it teaches you to write code in most efficient way. For example memory. You can define an array of 100 items OR use link list for the same. C is very raw language as it does not provide much help to the … | |
Re: Few checks:- 1. Check if pipe is opened properly. [CODE]if(al != NULL)[/CODE] 2. Check if your command is actually outputting something. Thats all I can see missing in the code. | |
Re: When you do: [CODE]functionName();[/CODE] you are basically calling the function. The correct way will be: [CODE]htmlElement.onclick = functionName; // No braces function functionName(event) { // Do stuff with event object. // Note: event object is passed automatically. } [/CODE] Solution for passing arguments to these function:- [CODE]htmlElement.onclick = function(e) { … | |
Re: Modifying little bit: [code='c'] void insert(StorePtr *store, CategoryPtr *cPtr) { CategoryPtr previousPtr; CategoryPtr currentPtr; (*cPtr)->nextCategory = NULL; currentPtr = (*store).headCategory; if (cPtr != NULL) { if ((*store).headCategory == NULL) { (*store).headCategory = *cPtr; } else { while (currentPtr-> nextCategory != NULL) { currentPtr = currentPtr->nextCategory; } currentPtr-> nextCategory = *cPtr; … | |
Re: Use style attribute like this: <input type="text" [B]style="font-size: 40px;" [/B]name="find"> | |
Re: Errors:- 1. In function Len_String(char *p) ---- int [COLOR="Red"]line (char *p)[/COLOR] is useless. Remove it. 2. In function Len_String(char *p) ----[COLOR="red"]*char_p[/COLOR] is undefined. Probably it should be *p (typo error) 3. In function CountCapitals(char *p) ---- while (*ch_ptr [COLOR="red"]! =[/COLOR] '\0'). There should be no sapce between ! and = … | |
Re: What is form.length?? Does this line make any sense?? | |
Re: check your code for list_item() function where you are looping through all items in newptr. apply same logic to loop in newptr2 and add items. | |
Re: Not every website provides apis to interact with their application. But now day websites like foursquare, tweeter etc provides well defined apis to interact with their web application. So I guess you can not accesses all the websites. | |
Re: Simplest way is to first convert the arrays to their corresponding integer values and then simple add them. here is the code to convert array values to integer:- [CODE]#include <iostream> #define MAX 20 using namespace std; int convertToInt(int *, int ); int main() { int num1[20] = {5,0,0,0}; int num2[20] … | |
Re: There nothing wrong with code. The only thing disturbing is comparing 2 arrays in if-condition. Remember array names are pointers to the first element. So you are comparing 2 different pointers. ;) |
The End.