293 Posted Topics

Member Avatar for noamwegner

'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; } } …

Member Avatar for Luckychap
0
4K
Member Avatar for techie929

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]

Member Avatar for Luckychap
0
103
Member Avatar for Sydney123
Member Avatar for iammirko

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)

Member Avatar for Luckychap
0
72
Member Avatar for debasishgang7

Use setInterval() method instead of setTimeout(). setInterval will repeatedly call a function at given interval [code=javascript] setInterval("sendRequest()", 2000 ); [/code]

Member Avatar for debasishgang7
0
129
Member Avatar for skides

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 …

Member Avatar for Luckychap
0
134
Member Avatar for Dean_Grobler

[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; } …

Member Avatar for haleel
0
7K
Member Avatar for tyson.crouch

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 = …

Member Avatar for haleel
0
79
Member Avatar for gazzy1

are you looking for something like this : [code=javascript] document.form.seconds.value = "00:00:" + (myTime < 10 ? "0" + myTime : myTime); [/code]

Member Avatar for Luckychap
0
2K
Member Avatar for new_developer

[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.

Member Avatar for Taywin
0
139
Member Avatar for Transcendent

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 …

Member Avatar for mark4013
0
266
Member Avatar for yashted

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]

Member Avatar for Luckychap
0
139
Member Avatar for erioch
Member Avatar for erioch
0
452
Member Avatar for McLaren

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>'; } …

Member Avatar for McLaren
0
764
Member Avatar for maverick420

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]

Member Avatar for Luckychap
0
173
Member Avatar for tekboi

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&&currentTime < 17) { document.write("<script> new TWTR.Widget({ version: 2, type: 'search', search: '@BigNotch', interval: 6000, title: 'Follow Me On Twitter', …

Member Avatar for Taywin
0
195
Member Avatar for briguy011

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 …

Member Avatar for Luckychap
0
198
Member Avatar for ankit.pandey3

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 …

Member Avatar for Taywin
0
144
Member Avatar for kalleanka
Member Avatar for axman1000

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 …

Member Avatar for peter_budo
0
348
Member Avatar for bettersaid

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 …

Member Avatar for bettersaid
0
158
Member Avatar for Luckychap
Member Avatar for Adak
0
2K
Member Avatar for Luckychap

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 …

Member Avatar for Airshow
-1
368
Member Avatar for Luckychap

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

Member Avatar for mojie
0
130
Member Avatar for BigFormat

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.

Member Avatar for BigFormat
0
186
Member Avatar for george61

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 …

Member Avatar for Taywin
0
232
Member Avatar for tldorr

Check this out: [url]http://www.w3schools.com/JS/js_cookies.asp[/url] After this you will be able to do what you want

Member Avatar for tldorr
0
107
Member Avatar for blanco_curious
Member Avatar for Luckychap
0
44
Member Avatar for SKANK!!!!!

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; …

Member Avatar for lifeh2o
0
172
Member Avatar for himmat.m4

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> …

Member Avatar for himmat.m4
0
94
Member Avatar for GreaseJunkie

I could not understand why you have defined more than 1 function with same name and same code?

Member Avatar for GreaseJunkie
0
187
Member Avatar for Luckychap
Member Avatar for burcin erek
0
1K
Member Avatar for skiabox
Member Avatar for pareshverma91

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.

Member Avatar for kainil
0
182
Member Avatar for Kadafiz

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.

Member Avatar for dhanapal86mca
0
144
Member Avatar for Luckychap

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

Member Avatar for drjohn
0
172
Member Avatar for lf.gene

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() …

Member Avatar for lf.gene
0
181
Member Avatar for moroccanplaya

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 …

Member Avatar for griswolf
0
361
Member Avatar for class11a

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.

Member Avatar for class11a
0
202
Member Avatar for lifeworks

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) { …

Member Avatar for lifeworks
0
1K
Member Avatar for NRaf

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; …

Member Avatar for jephthah
0
124
Member Avatar for still_learning

Use style attribute like this: <input type="text" [B]style="font-size: 40px;" [/B]name="find">

Member Avatar for NaveenRahul
0
85
Member Avatar for pinknblu

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 = …

Member Avatar for pinknblu
0
139
Member Avatar for vantrax
Member Avatar for jrw89
Member Avatar for Eumenio
0
135
Member Avatar for konata_89

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.

Member Avatar for Luckychap
0
134
Member Avatar for adobe71
Member Avatar for jPro

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.

Member Avatar for Luckychap
0
20
Member Avatar for Jeff_5_7

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] …

Member Avatar for Luckychap
0
97
Member Avatar for micmagicfly

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. ;)

Member Avatar for Banfa
0
96

The End.