Read config file on local machine? - JavaScript Help


Let me preface this with "I know next to nothing about Javascript, and usually can't even get a simple, pre-written JS function to run properly".

What I'm trying to do is develop a series of HTML templates that provide pseudo-dynamic data on a local machine.
For example, you could write a text file, name it "config.txt" and place it in the same directory as this template, zip it, and email it to me, and i open up the HTML file as a local file, and can view your content.

Sample "config.txt"

BACKCOLOR FFFFFF; TXTCOLOR 000000; :1: TXT " World! This is a page of text."; IMG picture.png; CLICK next [2]; :2: TXT "This is page 2."; IMG picture2.png; CLICK back [1]; CLICK next [3];
I guess it is like Powerpoint meets batch files or QBASIC. I know it's a lot of work for something really silly, and if there's an easier way to do it, by all means - let me know. Javascript is just the only client-side script I know of, and I'm even worse at Flash (IIRC, it has this capability with XML files).

The question is, can you (how do you...) import this file with Javascript, parse it, and somehow make the browser know which content to load. My hopes are to do something like PHP does:

....
Any thoughts
Posted On: Friday 28th of December 2012 04:24:58 AM Total Views:  80
View Complete with Replies

RELATED TOPICS OF JavaScript PROGRAMMING LANGUAGE




Import javascript in javascript

I know that I can import an css file in other css file with @import Ex: @import "style.css"; and i use this in allcss.css Can I do something like this in javascript, import a javascript in other javascript ;, I am looking for something more simple,like in css. The css example: Begin with four stylesheets: simple1.css ,simple2.css,simple3.css,simple4.css reffering to navigation,headers, special styles... I want to load them at once,so I make another css file all.css all.css - code @import "simple1.css"; @import "simple2.css"; @import "simple3.css"; @import "simple4.css"; the xhtml page code so,I import all files in only one http request I am looking for something similar in java script
VIEWS ON THIS POST

43

Posted on:

Saturday 24th November 2012
View Replies!

How to check if the textbox value is in the dropdown?

Good day! I need help.. I have to check if the textbox value is in the dropdownlist items, and I don't know how to get this in javascript. I wanted to validate it in such a way that if the textbox value is in the dropdownlist item values, then the selected index will be on the that value, while if theres no value in the dropdown list item, it will be returned to it it's default index which 0. I don't know much about javascript and I really need to use it..
VIEWS ON THIS POST

80

Posted on:

Saturday 24th November 2012
View Replies!

Drag and drop links

I am trying to create a web page for people with maladies of the hand. They have great difficulty with the double click. I want to be able to drag the links on my page to a "drop bucket". When dropped, the page should navigate to the link destination. Basically, drag, drop, and go. I have seen lots of code samples for dragging things around the page but nothing for dragging the link URL to activate it. Can anyone help
VIEWS ON THIS POST

87

Posted on:

Saturday 24th November 2012
View Replies!

log-in

I need some help in making the login like the daniweb...How am i going to do this that when i click the login it will show the div and the background will turns to gray.just like the daniweb...I am not quite good in javascript i am still studying on this... Thank you in advance.
VIEWS ON THIS POST

43

Posted on:

Saturday 24th November 2012
View Replies!

Accessing javascript functions inside ajax return?

Hi , I'm still pretty new to javascripting so be gentle I hope you can help me out a little on this one. I'm creating a page where I load some of my contents through ajax calls. In the returning content I'm trying to access some jquery features (lightbox for example). But this is apparantly not working out of the box I have a plugin on my joomlasite which generates a colorbox popup (lightbox) from all links with the class "modal". This apparantly is not working on the contents I return with the ajax call. From what I've seen , it seems that the plugin loads this little javascript snippet: $h(document).ready(function(){ $h('a.modalizer_link,a.modal,a.modalizer').colorbox({}); $h('a.modalizer_link_image').colorbox({}); $h('a.modalizer_link_external').colorbox({width:'80%',height:'80%',iframe:true}); }); And the javascript file itself is already added inside the main document. Do you have any advice on how I go about this to be able to access this function with the contents I return in my Ajax call And please... hold my hand a little here as I still consider my self a total n00b when it comes to Javascripting
VIEWS ON THIS POST

179

Posted on:

Saturday 24th November 2012
View Replies!

Help me please!

I am writing a JavaScript program that you click the mouse on a button and it shows how many times you have pressed the button. here is the JavaScript for it var numcount=0; function increasecounter(){ numcount++; document.getElementById('countdiv').innerHTML=numcount; } and here is the html: 0 now with that said, i would like to have a 30 second timer in the 'time' div. and when the timer goes off, i want the counter to stop counting the button clicks and show the score in the 'score' div. then when you click the 'reset' button the timer resets. how would i do this if somebody could help me that would be GREATLY appreciated
VIEWS ON THIS POST

123

Posted on:

Saturday 24th November 2012
View Replies!

How to make a hidden asterisk visible using java script?

. Im not very good with javascript. My knowledge is very limited. I need your help. See, this code is going to check if a user has inputted an empty field or not. As of now, Im testing it on 'first name' text field. If the user didn't input anything (the text field is empty) and clicks submit, an asterisk will be displayed at the right side of the text field. The asterisk is only temporary. If the user clicks the text field or refreshes the page, the asterisk at will disappear. I've googled it already and I've tried every technique I can find but I can't get this code to obey. Any suggestions ideas Assignment function aster(fn, ast) { if(fn.value.length==0) ast.style.visibility="visible"; } Create Account First Name * Last Name * Email * Password * /*External CSS*/ #ast1 { color:red; visibility:hidden; }
VIEWS ON THIS POST

169

Posted on:

Saturday 24th November 2012
View Replies!

Javascript switch with

This did not work.
VIEWS ON THIS POST

240

Posted on:

Saturday 24th November 2012
View Replies!

Javascript inside loop

, Sorry if I am cross-posting, but I can't seem to find a solution to this problem. I have a PHP while loop that retrieves records from my database. Inside the loop, I also have a Javascript counter that I need to generate for each record I retrieve (for each iteration). However, the counter only works for one record (i think it's the last iteration of the while loop). I'm guessing it's to do with a clash between the client-side javascript and the server-side php. Can anyone confirm this or tell me if there is a work around Many
VIEWS ON THIS POST

104

Posted on:

Saturday 24th November 2012
View Replies!

InnerHTML Table Coordinates

I'm trying to set table cells according to co-ordinates [x][y] - does anyone know if this is possible Here's what I've done so far: Trial & Error - Table Cells function getRow(t) { var col=t.cellIndex; //Gets column number clicked on. var row=t.parentNode.rowIndex; //Gets row number clicked on. var tableRow = document.getElementById("myRow"); //Gets row clicked on by Id. var tableCells = tableRow.getElementsByTagName("td"); //Gets cell inside row that was clicked on. document.testForm.inputA.value = (tableCells[0].innerText); //Sets the value of the input area. //Ideally I'd like something like this: document.testForm.inputA.value = (tableNAME[row][col].innerText); } Test A Ideally I'd like something like this: document.testForm.inputA.value = (tableNAME[row][col].innerText);
VIEWS ON THIS POST

25

Posted on:

Saturday 24th November 2012
View Replies!

Real-time countdown clock

, I am in need of a live real-time clock to count down to zero depending on the length of days specified in a database (Like an auction count-down timer). For example, I can retrieve the length of time specified in the database, somehow put that value into the clock and then let the timer count down to zero. Is there a particular scripting language I should be using for this E.g. Javascript/AJAX etc Does anyone know the best way to achieve this sort of functionality Your advice is much appreciated. Many
VIEWS ON THIS POST

83

Posted on:

Saturday 24th November 2012
View Replies!

Different behavior of HTML coded vs. dynamycaly created?

I found a principal differece between the behavior of staticaly (HTML) coded object the table row, and the same object created dynamicaly (DOM) with createElement() addChild() methodes. The folowing souce creates one HTML row and one DOM row and gives buttons to duplicate each row. HTML vs. DOM function start() { var oRow = document.createElement('tr'); oRow.id = 'DOM'; var oCell = document.createElement('td'); oCell.innerHTML = 'DOM' oRow.appendChild(oCell); var oCell = document.createElement('td'); var oButt = document.createElement('input'); oButt.type = 'button'; oButt.value = 'click'; oButt.onclick = function (){clickFce(this);}; oCell.appendChild(oButt); oRow.appendChild(oCell); var oCell = document.createElement('td'); oCell.innerHTML = 'sensitive text'; oCell3.onclick = function (){clickFce(this);}; oRow.appendChild(oCell); document.getElementById('tb').appendChild(oRow); } function dup(sID) { var oRowOrigin = document.getElementById(sID); var oTB = document.getElementById('tb'); oTB.replaceChild(oRowOrigin.cloneNode(true ),oTB.insertRow(oRowOrigin.rowIndex+1)); } function clickFce(something){alert(something.parentNode.nodeName);} HTML sensitive text The HTML row keeps the registrated function, the DOM one does not. I still did not find the causal explanation, what is the reason, what difference is in those two definition. Does anyone get the idea
VIEWS ON THIS POST

105

Posted on:

Saturday 24th November 2012
View Replies!

attachEvent

, I'm new to javascript, and need some help, why the following code refuses to do anything. .btn { background:URL("elemer.jpg"); width:200px; height:100px; display:block; } .btn.sfhover, .btn:hover { background-image:none; } sfHover = function() { var sfEls = document.getElementById(btn); sfEls.onmouseover=function() { this.className+= sfhover; sfEls.onmouseout=function() { this.className.replace(new RegExp( sfhover\\b), \t); } } } If(window.attachEvent) window.attachEvent(onload, sfHover); I get the error "sfHover isn't defined". What am I doing wrong The purpose of the code would be to add a :hover (here: .sfHover) css pseudo-class on the mouseover event, to work in IE. Any clues
VIEWS ON THIS POST

46

Posted on:

Saturday 24th November 2012
View Replies!

This is Kranthi of Ajax developper wanted help for?

I am doing Final year in Batchelor of Technology in the branch Information technology. I am devlopping an application in ajax that is Chatting application.Can u please help me to give the requirements
VIEWS ON THIS POST

89

Posted on:

Saturday 24th November 2012
View Replies!

whats wrong with my code?

You might try telling us what you WANT it to do.
VIEWS ON THIS POST

83

Posted on:

Saturday 24th November 2012
View Replies!

JavaScript execution delay

DaniWeb members, I've just joined up and I would like to have one of my problems solved. I'm still a begginer at JavaScript coding so my request may seem a be easy for you to answer so here it is: I have a JavaScript code and I want it to have a delay of 4 seconds before starting, the code is: [html][/html] I've searched through many sites and I havn't found an answer that'll help me, so i'm hoping that you will. :cheesy:
VIEWS ON THIS POST

69

Posted on:

Saturday 24th November 2012
View Replies!

Wana Make fast JavaScript

I am getting 'Unresponsive Script' error in FireFox1.5.03...and to fix this problem i need to make my script 'Fast' can anybody help me ..how can i make my script 'Fast'.... i need to modify my script ..which take less time to execute.... can anybody help me with some 'code Example' b'coz i m new with Java Script Symbol
VIEWS ON THIS POST

32

Posted on:

Saturday 24th November 2012
View Replies!

Where is event argument in F3

I need to get event handler's argument in Firefox3 - but it does not have any global 'event' variable like IE nor it passes an argument to the handler. How do I get this argument then\t function doSomething(e) { if(!e) var e = event; //for IE alert(e); //It shows 'undefined' in Firefox 3, WHY } .... , WOW! thanks! I thought it is passed automatically and didn't knew that I have 'event' variable available in FF
VIEWS ON THIS POST

89

Posted on:

Saturday 24th November 2012
View Replies!

Image Map Rollover error

I am working on an image map rollover...its basically done..but it isn't working in Firefox and I have an error in IE7, however it is still working in I.E.7...was wondering if somebody could take a look and see some glaring error that I am making in my code...It's a fairly basic double-image in a div..using an image map and a few javascripts and function calls...Note - i only finished the rollover effect on the first 3 images from the left - starting with the Bills, Dolphins and Patriots and excluding the A (afc logo). Here is a link to the menu: http://www.mfllive.com/nfltest.php Untitled Document arClips = new Array(); function setParams(the_clip,from,to) { arClips[the_clip] = new Array(); arClips[the_clip][0] = from; arClips[the_clip][1] = to } setParams(1,35,64); setParams(2,67,89); setParams(3,94,118); setParams(4,365,506); setParams(5,365,506); setParams(6,365,506); setParams(7,365,506); setParams(8,365,506); setParams(9,365,506); setParams(10,365,506); setParams(11,365,506); setParams(12,365,506); setParams(13,365,506); setParams(14,365,506); setParams(15,365,506); setParams(16,365,506); setParams(17,93,234); setParams(18,236,365); setParams(19,365,506); setParams(20,365,506); setParams(21,365,506); setParams(22,365,506); setParams(23,365,506); setParams(24,365,506); setParams(25,365,506); setParams(26,365,506); setParams(27,365,506); setParams(28,365,506); setParams(29,365,506); setParams(30,365,506); setParams(31,365,506); setParams(32,365,506); clTop = 1; clBot = 28; function MM_showHideLayersIM() { //v1.2 Modified by jlowery var i, visStr, args, theObj; var clRight, clLeft, the_clip; args = MM_showHideLayersIM.arguments; for (i=0; i
VIEWS ON THIS POST

161

Posted on:

Saturday 24th November 2012
View Replies!

Display the picture in [object HTMLImageElement] using?

I tried to access a cookie that has a [object HTMLImageElement] but I found out that cookies have a limit on size so Im trying to do this with pure Javascript I can store the value of what I want in a hidden div and now I want to pass that div to another page. Ive tried constructing it manually and Firebug SHOWS that I pass not only the GET value but also the variable YET I cannot print it out. Why cant I Please ask if you need any information. Thank you
VIEWS ON THIS POST

91

Posted on:

Sunday 25th November 2012
View Replies!

Dynamic Javascript form inputs with PHP data

I'm trying to figure out how to use PHP in Javascript to fill in the options for my drop down menus for my dynamic inputs. I've tried several things already, but I have had no luck. This is how my code stands at the moment. Any ideas are greatly appreciated.
VIEWS ON THIS POST

100

Posted on:

Sunday 25th November 2012
View Replies!

Passing variables from one object to another

I have implemented an Ajax object - a div containing another ASP file which can be updated dynamically. This ASP page has a number of checkboxes. Is it possible to use JS (or any other tool) to check the checkbox status (i.e. like javascript's if (field.checked) ) from the containing HTML/ASP file This is how I used to check the status when the checkboxes were in the containing HTML: But now the form is in the Ajax object's ASP file, so "document" wouldn't work. Ideas
VIEWS ON THIS POST

87

Posted on:

Sunday 25th November 2012
View Replies!

help with Ajax

hi i have taken from internet script that post data with the help of AJAX and PHP below is script function sendRequest() { new Ajax.Request("test.php", { method: 'post', postBody: 'name='+ $F('name'), onComplete: showResponse }); } function showResponse(req){ $('show').innerHTML= req.responseText; } what does here 'name='+ $F('name'), mean i espesially confused with $F('name')
VIEWS ON THIS POST

145

Posted on:

Sunday 25th November 2012
View Replies!

jQuery datepicker show how many selected

, I have a jQuery datpicker setup like this: $(function() { $('input').filter('#startPicker').datepick({ minDate: new Date(2010, 11, 20), maxDate: new Date(2010, 11, 27), multiSelect: 999, altField: '#date' }); }); is it possible to show the number of dates the user clicks on in the altfield, or somewhere else
VIEWS ON THIS POST

295

Posted on:

Sunday 25th November 2012
View Replies!

help need to update userlist...using ajax/jquery/javascript

hi i am trying to make a chat system ...using flash and php everything is done but cant update user-list in real-time ...i have Google it and find nothing ...can any one help me to update user-list as the come and go real-time.... using ajax/jquery/javascript or any thing....
VIEWS ON THIS POST

138

Posted on:

Sunday 25th November 2012
View Replies!

control session state using javascript

How can I perserve the session state of a SharePoint browser state using javascript
VIEWS ON THIS POST

90

Posted on:

Sunday 25th November 2012
View Replies!

Access over the internet

, I added some filtering and pagination functionality to a large table with JQuery. It runs fine if I access it locally on the server. But it runs very slowly if I access it over the internet. I don't understand this. I thought all javascript execute in the browser. Why would the events run slowly if the code is on the sever No ajax is involved. So, what am i missing Please help any input would be appreciated.
VIEWS ON THIS POST

107

Posted on:

Sunday 25th November 2012
View Replies!

Javascript / Safari Problem - Please Help!!!

Here is the dilemma. I have a website where everything works perfectly in all browsers except for Safari. When you are in Safari and you go to this page... http://www.3hounddesign.com/Woods_Woods/packaging.html The first time you click one of the numbered boxes at the bottom of the screen it advances to that number. However, after that, it won't advance to the next (or previous) number unless you use the arrows to forward to the next image. However, once you use the arrow to forward to the next image, you can then click on one of the number boxes again and have it work. But then once you click on the number box, it won't work again until you use an arrow to go to another image. The arrows always work, but the number boxes only work after you use an arrow. I need the number boxes to work. To see how it is supposed to work, you need only look at the site in Firefox or Explorer. It's driving me (and my client) crazy. Someone please help!
VIEWS ON THIS POST

31

Posted on:

Sunday 25th November 2012
View Replies!

Dynamically modifying the CSS attributes through Javascript

I was wondering if someone could aid me in this. all help will be duly noted in the script itself. Here is what i am trying to achieve, a realtime editor of the CSS attributes of a given page. I have the page i am using and the CSS table, but i want to be able to edit it in real time so that people can use it to create their profiles. SO lets say a user wants to create a profile, but doesnt want the lamo stock colors. they can use my basic template (which is a generic profile) and then dynamicly in real time modify different parts of the CSS so that all they would have to do is view source when they were finished and grab the CSS and input it into their profile, or use a generate button to generate the output when they are finished. Any help would be greatly appreciated, and if any more info is needed it would be greatly appreciated. one last breaze through of it: you have a CSS attributes form and it would lets say contain somthing like: table, tr { background-color:somecolor; } i need a script that can change that somecolor, to a color of the users choice. THank you in advanced to anyone that can offer any help or direction.
VIEWS ON THIS POST

81

Posted on:

Sunday 25th November 2012
View Replies!

Using JavaScript To Search .CSV File

Im completely new to jQuery so apologies for any obvious errors. I have a .CSV file with headings and data laid out as: Order Number, Stock Status, Quantity, Comments, Date 1234567, In Stock, 15, in Red, 15/08/2012 1234568, Out of Stock, 203, Leave with neighbor, 21/08/2012 1234569, On Order, 20, Chrome finish, 17/08/2012 1234570, Other, 140, Wooden garment, 01/09/2012 1234571, Other, 541, Chrome finish, 31/08/2012 I have a HTML page with 4 buttons (correspond with Stock Status): In Stock, Out of Stock, On Order, Other, What I am trying to do is when I click one of the above, my code goes away, searches for all records that match on Stock Status column and returns Order Number, Quantity and Comments. Code so far: // On opening the site, show the loading icon and GIF. $(document).ready(function () { $("#Outline").hide(); $("#loadingTable").delay(1000).hide(0); var data = []; // Empty array in global scope where we will store your data // Your ajax call to get the data and store it in the var above $.ajax({ type: "GET", url: "data.txt", dataType: "text", success: function (data) { processData(data); } }) }); function showSLAMenus() { $("#Outline").show(); }; setTimeout(showSLAMenus, 1001); $("#Other").click(function () { alert("Other1") // An example search call var output = searchData(data, "Other"); alert("Other2") // Dump out the results of our search for (var i in output) { $("div#output").html(output[i] + ""); } }); // Main function to process the data into an array function processData(allText) { var allTextLines = allText.split(/\r\n|\n/); var headers = allTextLines[0].split(','); var lines = []; for (var i = 0; i < allTextLines.length; i++) { var data = allTextLines[i].split(','); if (data.length == headers.length) { var tarr = []; for (var j = 0; j < headers.length; j++) { tarr.push(headers[j] + ":" + data[j]); } lines.push(tarr); } //alert(lines); } return lines; // Returns the data you need, to be stored in our variable } // A search function using the jQuery inArray method // - matches the data position in the array and returns a new array of matched data function searchData(data, search) { alert("searchData Called") // Create a temp array to store the found data var tempArray = []; // Loop through the data to see if each array has the search term we need for (i = 0; i < data.length; i++) { var pos = $.inArray(search, data[i]); // Add found data to the array if (pos !== -1) { tempArray.push(data[i]); } } // Return the array of matched data return tempArray; } However, looking at my code, when clicking the Other button $("#Other").click(function () { alert("Other1") var output = searchData(data, "Other"); alert("Other2") // Dump out the results of our search for (var i in output) { $("div#output").html(output[i] + ""); } }); Alert Other1 is displayed, but it fails to call searchData i believe.
VIEWS ON THIS POST

66

Posted on:

Monday 26th November 2012
View Replies!

Tile Background Changing

. I'm creating a 'map' for my game. I've got a 13x13 tile layout and using PHP I've loaded all the tiles. What I'm looking to do is grab all the tiles whose class names are 'water' and create a loop that'll change their background every second between four possible images Sadly javascript ISN'T my thing Many
VIEWS ON THIS POST

29

Posted on:

Monday 26th November 2012
View Replies!

Calculating age using date of birth

hi, I've got a problem and i really need help. this is my code var y= new Date(); y.getFullYear() + ''; alert(y); var year = new Date(); year.setFullYear(prompt('Enter the year','1990'),prompt('Enter the month','1'), prompt('Enter the day','1')); alert(year); var yy = y-year; alert(yy); i want when a user write his/her birthday JS calculate the age. that's all
VIEWS ON THIS POST

217

Posted on:

Monday 26th November 2012
View Replies!

Insert value to textarea using a WYSIWYG editor

Trying to accomplish a simple test for a project I'm working on. The Form The textarea has a WYSIWYG added to it (not needed but just in case here is that function var hb_silk_icon_set_blue = $("#agreement_text").css("height","240").css("width","695").htmlbox({ toolbars:[ ["bold","italic","underline","strike","undo","redo","separator_dots","left","center","right","justify"] ], icons:"silk", skin:"blue" }); I was able to get a border around the text area using this line: $('#agreement_text_html').css('border','3px solid red'); But still not able to set a value with that selector (I've tried quite a bit as well).Summarized Thank you for any help, I'm pretty familiar with PHP/JS/JQUERY/AJAX so any help may go a long way, I've already google everything I can think of.
VIEWS ON THIS POST

171

Posted on:

Monday 26th November 2012
View Replies!

Nothing is happening in value

hello im having trouble getting the value of counter to = something here is me code function countdown(){ frmcountdown.counter.value=timer; x=frmcountdown.counter.value; x--; frmcountdown.counter.value=x; if (x>0){ setTimeout("countdown()",1000); } else{ alert("out of time"); } }
VIEWS ON THIS POST

68

Posted on:

Monday 26th November 2012
View Replies!

Resize a BG Image based on Screen Resolution

, I am looking at an easier way to have the background-image for a site be resized so that it looks the same across all screen resolutions (or at least close enough). The way I am doing it now is by using Javascript to get the width of the screen and then loading an appropriate sized image. Looks like this: Background Image for Varying Screens function selectBG() { var x = screen.width; var y = screen.height; alert(x); if(x == 1280) { document.body.style.backgroundImage = "url('images/mountainbg2.jpg')"; } if(x == 1024) { document.body.style.backgroundColor = "url('images/mountainbg3.jpg')"; } } Obviously this is still not gonna work on a lot of resolutions as I will have to hand resize the image for each occasion and then add more code each time as well. Just was to see if anyone might have another way they have used or any ideas to do it differently.
VIEWS ON THIS POST

50

Posted on:

Monday 26th November 2012
View Replies!

"with" statement in javascript

Dear all, could you tell me what is "with" statement for Is this a function What does it do I try to google it, but found a hard time to figure it out since "with" is a generic word.... The following snippet I found in the web: function validate_required(field,alerttxt) { with (field) { if (value==null||value=="") { alert(alerttxt);return false; } else { return true; } } } So in this example, what does "with" do regards, ethereal1m
VIEWS ON THIS POST

31

Posted on:

Monday 26th November 2012
View Replies!

blinking div problem

i'm really new to jquery and i don't know how to solve this. i added following code to blink a div. initially mypopup div is hidden. and 10 seconds after page was loaded this div appears. because of this toggle() method div displays for 10 more seconds before hiding again. if i want to show that div only for 3 second what can i do\t var blink = function(){ //$('#mypopup').css({left:0px, top:0px} $("#mypopup").css({"left": "0px"}); $("#mypopup").css({"top": "0px"}); $('#mypopup').toggle(); }; $(document).ready(function() { setInterval(blink, 10000); });
VIEWS ON THIS POST

82

Posted on:

Monday 26th November 2012
View Replies!

JavaScript and HTM OnChange Attribute

I have a question about the Javascript and HTML onchange attribute. If you write a script that changes the value of an HTML , would that be considered an onchange and subsequently execute another function Or is there a better way of writing this For example... function KeyUp() { document.getElementById("text").value="rawr"; } function onchange() { document.getElementById("time").value=date(now); } function Final() { document.getElementById("final").value="explodatron"; } , This is actually an idle checker. If the user is typing in information, I don't want it to count against their idle timer. I've thought of using cookies, but am unsure of how to [correctly] implement them.
VIEWS ON THIS POST

60

Posted on:

Monday 26th November 2012
View Replies!

Reload/Redirect to a form without losing data

I'm working on a contact form. I have the form being checked by a PHP script once it's submitted. If the script finds an error, it will load a new page with the error message and then redirect back to the form after 10 seconds so the user can correct the error. The problem is that when the form reloads, it is blank. How can I have the form reload and keep the entered data This is what I'm using now: window.setTimeout("window.location = './contact.htm'", 10*1000 );
VIEWS ON THIS POST

191

Posted on:

Monday 26th November 2012
View Replies!

Add Class, Not setAttribute - JavaScript Help

How do I add a class without using setAttribute I need to change setAttribute in the code below. var drop_selected = document.getElementsByName('search_category'); for (var x in drop_selected) { drop_selected[x].onclick = function(){ for (var c=0; c
VIEWS ON THIS POST

72

Posted on:

Tuesday 27th November 2012
View Replies!

Javascript Events Without HTML

I am not quite sure how to ask this but I want to have a javascript function run when you mouse over an html object without adding the event in the html. I want to do it just by linking a javascript file.
VIEWS ON THIS POST

55

Posted on:

Thursday 29th November 2012
View Replies!

How do I combine these two form validation scripts?

Hi I have the following script which works nicely: $(document).ready(function()//When the dom is ready { $("#MembershipNo").change(function() { //if theres a change in the MembershipNo textbox var MembershipNo = $("#MembershipNo").val();//Get the value in the MembershipNo textbox if(MembershipNo.length == 7)//if the lenght greater than 3 characters { $("#availability_status").html(' Checking availability...'); //Add a loading image in the span id="availability_status" $.ajax({ //Make the Ajax Request type: "POST", url: "ajax_check_MembershipNo.php", //file name data: "MembershipNo="+ MembershipNo, //data success: function(server_response){ $("#availability_status").ajaxComplete(function(event, request){ if(server_response == '0')//if ajax_check_MembershipNo.php return value "0" { $("#availability_status").html(' Available '); //add this image to the span with id "availability_status" } else if(server_response == '1')//if it returns "1" { $("#availability_status").html(' Not Available '); } }); } }); } else { $("#availability_status").html('MembershipNo is wrong length'); //if in case the MembershipNo is less than or equal 3 characters only } return false; }); }); But I need to check that the entry is numerical only so I found this bit of script: function isNumeric(elem, helperMsg){ var numericExpression = /^[0-9]+$/; if(elem.value.match(numericExpression)){ return true; }else{ alert(helperMsg); elem.focus(); return false; } } But how do I combine them both so that it first checks it it numerical only and then checks the db for duplicates
VIEWS ON THIS POST

174

Posted on:

Thursday 29th November 2012
View Replies!

security of javascript

I had a question about javascript. Since it is clientside can a user modify the contents of my scripts. For example I am using jquery's css() command to disable a button if a user is not logged in. Can a user access this and change it so the button is enebaled
VIEWS ON THIS POST

52

Posted on:

Thursday 29th November 2012
View Replies!

FAQ Topic - Why does framename.print() not print the correct frame in IE? (2008-02-24)

----------------------------------------------------------------------- FAQ Topic - Why does framename.print() not print the correct frame in IE ----------------------------------------------------------------------- IE prints the frame that has focus when you call the print method ` frameref.focus();frameref.print(); ` http://msdn2.microsoft.com/en-us/library/ms976105.aspx -- Postings such as this are automatically sent ...
VIEWS ON THIS POST

75

Posted on:

Friday 30th November 2012
View Replies!

HTML page

How can I flash a web page and also generate a beep to the PC from HTML page This I need to alert people if something happens....
VIEWS ON THIS POST

61

Posted on:

Friday 30th November 2012
View Replies!

IE 7 memory leak when you remove an element from page, or Drip bug?

Hi. I have a element, with in it and inside , all created statically (e.g. poresent in HTML when the page loads). Later I execute the code that adds reference to td in question to a JS ...
VIEWS ON THIS POST

179

Posted on:

Friday 30th November 2012
View Replies!

creating a pdf file using javascript!

is it possible to create a pdf documment using javacript is there a function built in that does it , like fpdf in php...
VIEWS ON THIS POST

78

Posted on:

Friday 30th November 2012
View Replies!

setTimeout and do...while aren't working out.

The webpage freezes and Google Chrome returns an "Aw, Snap" page. Any ideas :| title-ref.js var x=0; var gh=true; function changeTitle() { x++; switch(x) { case 1: document.title="Studio Notex :)/>"; break; case 2: document.title="Studio Notex ;)/>"; break; case 3: document.title="Studio Notex :3"; break; case 4: document.title="Studio Notex :D/>"; break; case 5: document.title="Studio Notex >:3"; gh=false; break; default: document.title="Studio Notex :)/>"; break; } } do { setTimeout("changeTitle();", 1000); } while (x < 6 && gh); index.php Studio Notex :)/> Hope this works... Loading.. It works without the two script references in .
VIEWS ON THIS POST

33

Posted on:

Sunday 23rd December 2012
View Replies!

How to call vb.net code behind function using javascript

I have a function in aspx.vb (code behind fucntion). Now I want to call this function using javascript... How can I call
VIEWS ON THIS POST

34

Posted on:

Sunday 23rd December 2012
View Replies!

popup not rendering - JavaScript Help

Hi ,The a tag below opens a popup window once click which works fine in html body tag:testThe problem is am selecting entries from my database and using php to render the link dynamically and it doesnt seem to work I cant figure out why, here's the php input: Here is also the also the javascript which makes it possible
VIEWS ON THIS POST

68

Posted on:

Friday 28th December 2012
View Replies!