293 Posted Topics
Re: 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] | |
Re: [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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: Write a function for onsubmit event for ur form and then in that function send a ajax request to the server. What say? | |
Re: [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 | |
Re: 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] | |
Re: 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. | |
Re: [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] | |
Re: There is no mechanism for bring content out of local domain with Ajax. | |
Re: 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++) … | |
Re: 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. | |
Re: 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. | |
Re: 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 … | |
Re: 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_' + … | |
| |
Re: As far as I know: Alt + f9 -> just complile use: Ctrl + f9 -> compile + run :) | |
Re: 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 … | |
| |
Re: 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 … | |
Re: The best and simple one be: Do not show past dates at all. | |
Re: [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'? | |
Re: May because of [B]position: relative[/B] as the modal background is pushing it offscreen. Try making it absolute. | |
Re: 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 … | |
Re: use z-index css property to bring up your javascript menu. | |
Re: 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 } … | |
Re: 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, … | |
Re: 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 … | |
Re: 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. | |
Re: 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++ … | |
Re: 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 … | |
Re: 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 … | |
Re: 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(); … | |
Re: [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 … | |
Re: 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 … | |
Re: [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 … | |
| |
Re: Very common mistake in for loop: [code='c'] for(i=0; inputDone == 'y'; i++) [/code] did u get this!! | |
Re: anchor tag looks like this: [code='html'] <a id="anchor_1" href="www.mysite.com/#a_id=joe&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 … | |
Re: [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] | |
Re: 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 … | |
Re: 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 … | |
| |
Re: [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(" + … | |
Re: Are you saving the quantity some where? I guess you are not. And If yes tell where u r saving the selected quantity. | |
Re: may this help you: [url]http://developer.yahoo.com/yui/examples/carousel/csl_imagentext_source.html[/url] | |
Re: 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] |
The End.