293 Posted Topics

Member Avatar for Samir

Use javascript encodeURIComponent() Function to encode the url you are passing before sending. More info:- [url]http://www.w3schools.com/jsref/jsref_encodeURIComponent.asp[/url]

Member Avatar for Luckychap
0
98
Member Avatar for Leratom

[QUOTE=Leratom;1170074]I need to create a table: inside a table i must have the picture with a heading, link<< 1 of 2 >> ,abstract and full story, read more news. When clicking on the link 1 of 2 the image must change along with the heading and abstract.[/QUOTE] So what you …

Member Avatar for Luckychap
0
59
Member Avatar for lionaneesh

Adding one more [CODE]if( c[i] [COLOR="red"]=[/COLOR] '\t')[/CODE] will be always true Bad coding:- [CODE]for( i = 0 ; i <= ([COLOR="Red"]x = (strlen(c)[/COLOR])) ; i++)[/CODE] Here every iteration will call strlen(c)....which is bad. Store the length once before loop starts.

Member Avatar for Luckychap
0
142
Member Avatar for skorm909

Steps:- 0) Set current menu to main menu 1) Show current menu 2) Get user input 3) Hide current menu 4) Use user input to decide which sub menu to show 5) Set current menu to sub menu 6) Repeat streps 1 to 6 until exit Does this makes any …

Member Avatar for Luckychap
0
78
Member Avatar for mir_sheely

You are drawing circle from the center(cx,cy) of the square so to fill color outside the circle and in side the square you should use in this way floodfill(cx+radius + 2, cy + radius + 2 , color); where radius: radius of the inside circle and color: color to be …

Member Avatar for SHAHEER BANO
0
815
Member Avatar for tiger86

my be this would(i have not tired it). Javascript code are written in <script></script> tags. So search these tags in the document by using: var sTag = document.getElementsByTagName("script"). This will give u an array of script tags. Now over write them by using sTag[0].innerHTML = "your javascript code"; If this …

Member Avatar for sozeran
0
186
Member Avatar for coldrain

Write a function for onsubmit event for ur form and then in that function send a ajax request to the server. What say?

Member Avatar for Njegos
0
94
Member Avatar for rohanvijay

[QUOTE=rohanvijay;756467]1. Write a C program to convert a given infix expression to postfix form using stacks 2. Write a C program to evaluate the postfix expression using stacks[/QUOTE] WOW!! More assignments for daniweb!!! :D

Member Avatar for Chilton
0
175
Member Avatar for ablitz

May this help [code='javascript'] $(document).ready(function() { $("ul.sc_menu a").click(function() { $('#content #mainbg #infobox #trackinfo').animate({opacity:"0"}); $.post('projects-agent.php', {'title': $(this).text()}, function(data) { //$('#content #mainbg #infobox #trackinfo').html(data); $('#content #mainbg #infobox #trackinfo').animate({opacity:"1"}, function(){this.html(data)}); }); return false; }); }) [/code]

Member Avatar for Luckychap
0
213
Member Avatar for DARK_BYTE

NO, both will behave differently if you click 'cancel' on confirmation dialog instead of clicking 'ok'. Now its ur job to figure out something from this.

Member Avatar for DARK_BYTE
0
172
Member Avatar for hajjo

[code='javascript'] function getId() { var table = document.getElementById('your-table-id'); var rows = table.getElementsByTagName('tr'); var newId; if(rows && rows.length) { var lastRowId = rows[rows.length-1].id; newId = 'row' + parseInt(lastRowId.substring(lastRowId.indexOf('row')+1, lastRowId.lendth)) + 1; } else { newId = 'row0'; } return newId; } [/code]

Member Avatar for Luckychap
0
91
Member Avatar for Weesh
Member Avatar for codejoust
0
171
Member Avatar for MaestroRage

You can use {} with arrays only when initializing. [code='c'] char ba[25][12] = {"item[0][0]", "item[0][1]", "item[0][2]",......, "item[0][11]", "item[1][0]", "item[1][1]", "item[1][2]",......, "item[1][11]", . . . "item[24][0]", "item[24][1]", "item[24][2]",......, "item[24][11]", } [/code] After initializing you need to assign it using [][] = value [code='c'] for(int i = 0; i < 25; i++) …

Member Avatar for Tom Gunn
0
2K
Member Avatar for Cheeki

As you know Ajax is asynchronous, so your thinking is correct. The variable is set synchronously and respond is asynchronous(ajax). Check your code where the ajax request has completed for that variable.

Member Avatar for Luckychap
0
133
Member Avatar for willingj

What you want from us to do from this crapy code. No code tags, no comments. Please put code tags and comments in your code.

Member Avatar for akulkarni
0
117
Member Avatar for polo_coins

Hope this little code will help you: [code='html'] <html> <head> <style> div#clock { position: absolute; border: 2px solid ccc; background-color: c0f; text-color: 000; width: auto; right: 2%; } </style> <script language="javascript"> var clockDiv; function initiateClock() { clockDiv = document.getElementById('clock'); if(!clockDiv) return; updateClock(); setInterval(function(){updateClock();}, 1000); } function updateClock() { var time …

Member Avatar for fuego2008
0
156
Member Avatar for sam023

If all is working fine then you can use rowIndex as generating id. [code='javascript'] function add(oRow) { var selObj = oRow.getElementsByTagName('select')[0]; if(selObj[0].selected){ // Check for empty ledger entry alert("Please select ledger"); return false; } oRow.parentNode.replaceChild(oRow.cloneNode(true),oRow.parentNode.insertRow(oRow.rowIndex+1)); var inpR = oRow.getElementsByTagName('input'); var inpN = oRow.nextSibling.getElementsByTagName('input'); // Setting id inpN.id = 'textBox_' + …

Member Avatar for Troy III
0
183
Member Avatar for alvalany
Member Avatar for alvalany
0
205
Member Avatar for yeshkadiyala
Member Avatar for Salem
0
168
Member Avatar for jyotiu

I hope this will help you: [code='html'] <html> <script> function callAll() { for(var i = 0; i < 3; i++) { window['myFunction' + i](i); } } function myFunction0(i) { alert(i); } function myFunction1(i) { alert(i); } function myFunction2(i) { alert(i); } </script> <body onload='callAll()'> </body> </html> [/code] But this is …

Member Avatar for essential
0
138
Member Avatar for Curgol
Member Avatar for aashishn86

You assigned: var dt=document.getElementById("application_doj" + iteration).value dt has already got value. So pass only dt in isDate(dt). [code='javascript'] function ValidateForm() { alert("hi from ValidateForm") //var dt=document.transaction.application_doj' + iteration //alert(dt) iteration=document.getElementById("no_of_applications").value alert(iteration) var dt=document.getElementById("application_doj" + iteration).value // var dt=document.getElementById("application_doj2").value alert(dt) if (isDate(dt.value)==false){ // dt.value is undefined, pass only dt //dt.focus() return …

Member Avatar for aashishn86
0
617
Member Avatar for gagan22
Member Avatar for neclark2

[QUOTE=neclark2;930543]Usually, they will just show up as broken images, but when I navigate to the url of the image that is 'broken', it displays just fine. [/QUOTE] What do you mean by 'broken image'?

Member Avatar for essential
0
82
Member Avatar for whatshakin

May because of [B]position: relative[/B] as the modal background is pushing it offscreen. Try making it absolute.

Member Avatar for Luckychap
0
63
Member Avatar for aashishn86

You can use this simple method to add new text boxes: - [code='javascript'] /* container - HTML element in which textBox needs to be added labelString - (optional) Label string for text box textValue - (optional) Text value for text box */ function addNewTextBox(container, labelString, textValue) { if(!container) { return …

Member Avatar for Luckychap
0
129
Member Avatar for Ibn Saeed
Member Avatar for Xessa

From servlet you send response as true or false. But at client end ie javascript the response will be string 'true' or 'false'. So u need to compare as something like this: [code='javascript'] var result = resquest.responseText; if(result == 'true') { // Not if(result == true) // Success code } …

Member Avatar for essential
0
107
Member Avatar for shakeelahmed22

A simple solution: [code='java'] int draw() { int pat[7][7] = { 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, …

Member Avatar for freelancelote
0
146
Member Avatar for Xessa

For this you have to send data from HTML to the server by sending HTTP request to server. You can use <form> to submit data to server (.jsp file). In jsp you can do database interaction using JDBC. After that you will get resultset by executing SQL queries (SELECT...), you …

Member Avatar for kvprajapati
0
128
Member Avatar for 7gakki

You have used so many tables in your HTML. I can only suggest you to re-check your HTML code. May be some <td> <tr> </td> </tr> tags are missing.

Member Avatar for essential
0
166
Member Avatar for bufospro

Based on [B]jephthah[/B] comments I tried to write code: [code='c'] float *save_array(int N) { float *a,*b; int i; // Allocate memory for N floats a = malloc(sizeof(float) * N); // Assign temp pointer 'b' to a b = a; // Get 10 floats for(i = 0; i < N; i++ …

Member Avatar for Luckychap
0
113
Member Avatar for jimmiller96

Hey, you can always have hidden input tag to which you can set values in form. For example:- [code='html'] <form action="page.php" method="post"> <input type='hidden' name='var1' value='param1'/> <input type='hidden' name='var2' value='param2'/> <!-- Rest of our form elements -> </form> [/code] so when you submit this form you can get those hidden …

Member Avatar for jimmiller96
0
146
Member Avatar for grisha83

Where are you adding first node (head)? If addValue() is suppose to add new nodes then head should also be added in this function. But it seems you are adding is manually something like this: [code='c'] head = new IntNode(value); [/code] As far as your present code is concerned you …

Member Avatar for grisha83
0
67
Member Avatar for m-hrt

Date Comparison is really hard in javascript. So I wrote 2 very useful functions for the same. I think this is right time to post: [code='javascript'] // Checks if 2 input dates are same function areSame(date1, date2) { var date1Date = date1.getDate(); var date1Month = date1.getMonth(); var date1Year = date1.getFullYear(); …

Member Avatar for m-hrt
0
2K
Member Avatar for re-volter

[code='javascript'] function getLocation() { var siteurl = document.location.href; // Remove '//' in above string so that we can easily extract our desired string based on '/' string. Doing so will not conflict with '//'. var pStr = siteurl.replace("//",""); // Now extract substring from first index of '/' till last var …

Member Avatar for mail2saion
0
106
Member Avatar for azjherben

I have a question regarding coping of files:- Is there any difference between [B]Ancient Dragon's[/B] style of coping each byte at a time by looping through till EOF and [B]azjherben's[/B] style of coping in one shot? I mean to ask about efficiency and all. I think azjherben's would be faster …

Member Avatar for Luckychap
0
823
Member Avatar for itsjareds

[B]getElementById()[/B] only works with [B]document[/B]. To parse your HTML can use [B]childNodes[/B]; Modifying your code all little bit: [code='javascript'] function parseHTML(html) { var root = document.createElement("div"); root.innerHTML = html; // Get all child nodes of root div var allChilds = root.childNodes; // Loop through all the child nodes and check …

Member Avatar for itsjareds
0
4K
Member Avatar for OmniX
Member Avatar for zack.walters

Very common mistake in for loop: [code='c'] for(i=0; inputDone == 'y'; i++) [/code] did u get this!!

Member Avatar for yun
0
147
Member Avatar for cjay175

anchor tag looks like this: [code='html'] <a id="anchor_1" href="www.mysite.com/#a_id=joe&amp;b_id=11111" >click to visit (something like this)</a> [/code] now to get the href property (url) you need a reference to anchor tag. That can be done in javascript like this:- [code='javascript'] var anchor1 = document.getElementById('anchor_1'); var url = anchor1.href; [/code] here url …

Member Avatar for cjay175
0
468
Member Avatar for learnerasp

[QUOTE=Airshow;870731]Learnerasp, Style your div with [ICODE]position:absolute; display:none;[/ICODE] then show/hide it in javascript with: [ICODE]divObj.display = 'block';[/ICODE] [ICODE]divObj.display = 'none';[/ICODE] where [ICODE]divObj[/ICODE] is the DOM reference to the div in question (use eg. document.getElementById(id) to discover it). [B]Airshow[/B][/QUOTE] Correction: [ICODE]divObj.style.display = 'block';[/ICODE] [ICODE]divObj.style.display = 'none';[/ICODE]

Member Avatar for Airshow
0
172
Member Avatar for miniroselit

for simplification returned array will be of type: [code=c] int array[100][20] ; [/code] or u can modify above function to get variable 2D array: [code=c] int** foo(int row, int col) { int i; int** array = malloc(row * sizeof(int *)); for(i = 0; i < 100; i++) array[i] = malloc(col …

Member Avatar for Luckychap
0
147
Member Avatar for kvprajapati
Member Avatar for Potato.Head

Make that object global in one .js file and include it in both your pages. [B]gobal.js[/B] [code='javascript'] var gObject = yourObject; [/code] [B] page1.html[/B] [code='html'] . . . <script src="global.js"></script> <script> gObject = somthing; </script> . . . [/code] [B] page2.html[/B] [code='html'] . . . <script src="global.js"></script> <script> var usegObj …

Member Avatar for Airshow
0
204
Member Avatar for veledrom
Member Avatar for arvindikchari

[code='javascript'] <html> <head> <title>test</title> <script type="text/javascript"> function applyStyle() { var bgText = document.getElementById('bg').value; var hoverText = document.getElementById('hover').value; var myDiv = document.getElementById('mydiv'); myDiv.style.backgroungImage = "url(" + bgText + ")"; myDiv.onmouseover = function() { alert(hoverText); myDiv.style.backgroungImage = "url(" + hoverText + ")"; } myDiv.onmouseout = function() { alert(bgText); myDiv.style.backgroungImage = "url(" + …

Member Avatar for Luckychap
0
202
Member Avatar for gagan22

Are you saving the quantity some where? I guess you are not. And If yes tell where u r saving the selected quantity.

Member Avatar for Luckychap
0
126
Member Avatar for leroi green

may this help you: [url]http://developer.yahoo.com/yui/examples/carousel/csl_imagentext_source.html[/url]

Member Avatar for leroi green
0
81
Member Avatar for coolkille

simple: [code='html'] <style> .mytable { /*Your table css*/ } </style> <table class="mytable"> <tr> <td> <div> fixed to the <a class="wiki-summary-link" href blabla bla....></div> </td> </tr> </table> [/code]

Member Avatar for coolkille
0
169

The End.