JQuery hidden adjacent div issue - JavaScript Help


, I am just starting to get into jQuery and I have run into a problem that is annoying the hell out of me. I have a menu with all the main options for the site. However, this site is part of a large network; so I need to include an option for the global nav for the network. The current menu for the site is so:
Home About Archives Contact Subscribe to RSS I didn't write this page, just going in to add the global nav. Anyway, I modified the menu as such and added the following under it:
+/- Home About Archives Contact Subscribe to RSS writeTopGlobal_transition(); writeBotGlobal_transition(); $(function() { $('.hiddenNav').hover(function() { $('.globalNav').show(); }); $('.globalNav').hover(function() {}, function() { $('.globalNav').hide() }); }); The two functions in hidden div basically do a document.write of the global nav (which is fairly extensive). Anyway, here is my issue. As you can probably guess with my code I want the global nav to appear when a user hovers over the "+/-" link in the main menu. Then I need it to stay active as long as they are over it. Currently, this works fine. The global nav goes away when they move their mouse off of it. However, during testing I noticed my issue. If you just hover over the "+/-" and never go to the global nav section it stays open. I need it to act much like a drop down in that if the user hovers over the "+/-" the nav shows up and if they move it goes away....unless they move to the nav where it should stay up until they move off of it.
Posted On: Friday 28th of December 2012 04:28:58 AM Total Views:  233
View Complete with Replies

RELATED TOPICS OF JavaScript PROGRAMMING LANGUAGE




NAME SEPARATION

hi fellas, need some brilliant idea, i want to get the firstname,lastname,middlename of the employee below using javascript. ________________________ Atty.Jan Rex Camvarijan Rex Uy Cambarijan Rex Cambarijan Rex Ma.Rex B. Cambarijan ||| Rex del Rosario __________________________ what i really want is how could i separate lastname firstname middlename in those diffirent structuce of name
VIEWS ON THIS POST

44

Posted on:

Monday 19th November 2012
View Replies!

how to clear fields in a form using javascript onload?

Home reset your password Fields with*are mandatory * PF * Date Format * email
VIEWS ON THIS POST

123

Posted on:

Monday 19th November 2012
View Replies!

What does this script do?

, I was given this script (without the comments), and I need to figure out what it does. I've added the comments as a guess as to what it does, but I have never done any javascript before. So clarifications would be appreciated. var _0x39e7=["\x76\x61\x6C\x75\x65", // value "\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64", // getElementById "\x3C", // < "\x26\x6C\x74\x3B", // < "\x72\x65\x70\x6C\x61\x63\x65", // replace "\x3E", // > "\x26\x67\x74\x3B", // > "\x5C\x22"]; // \" function sanitize(_0xe049x2){ var _0xe049x3=document[_0x39e7[1]](_0xe049x2)[_0x39e7[0]]; // x = document.getElementById(BLAH).value var _0xe049x4=_0xe049x3[_0x39e7[4]](_0x39e7[2],_0x39e7[3]); // y = x.replace(, >); _0xe049x4=_0xe049x4[_0x39e7[4]](/"/g,_0x39e7[7]); // y = y.replace(/"/g, "\""); document[_0x39e7[1]](_0xe049x2)[_0x39e7[0]]=_0xe049x4; // document.getElementById(BLAH).value = y } ; So if all of my comments are indeed correct, what does the replace(/"/g, "\"") call do It seems like we are replacing quotes by quotes ... or something Doesn't seem to make much sense to me...
VIEWS ON THIS POST

95

Posted on:

Monday 19th November 2012
View Replies!

basic loop

Hi. I try to use some of the OOP. function Tag(name, value, x, y){ this.name = name; this.value = value; this.x = x; this.y = y; } var star = new Tag( 'sun', 29, 10, 10); var cube = new Tag('cube', 101, 10, 20); var circle = new Tag('red ball', 50, 10, 20); now how would i create a loop that will scan all the objects that created and do sotmthing like that: for (obj in object.Tag) { alert (obj.name); } thank you MOD EDIT: When posting code...USE CODE TAGS!!! This post has been edited by JackOfTrades: 14 October 2010 - 03:31 PM
VIEWS ON THIS POST

207

Posted on:

Wednesday 21st November 2012
View Replies!

problem with email validation

Hi I need to validate an email with a user specific suffix and the email textbox need to have this email suffix whih cannot be deleted, user can only add the prefix and the suffix remains unedited (e.g. @abc.com) if (document.form1.email.value.length > 0) { var tst = document.form1.email.value; var okd = ['abc.com'] for (var i = 0; i < okd.length; i++) { okd[i] == okd[i].toLowerCase() } var emailRE = /^[a-zA-Z0-9._+-]+@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,4})$/ var aLst = emailRE.exec(tst) if (!aLst) { alert(tst + ' is not a valid e-mail') } else { var sLst = aLst[1].toLowerCase() for (var i = 0; i < okd.length; i++) { if (sLst == okd[i]) { // alert(aLst[1] + ' is allowed');--> } } if (i == okd.length) alert(aLst[1] + ' is not allowed. Please enter an email address with an authorized domain.') document.form1.email.select(); return false; } }
VIEWS ON THIS POST

79

Posted on:

Wednesday 21st November 2012
View Replies!

JavaScript age verification

, this is my first post on here and looking for some help with JS. I am having issues figuring out the coding for age verification. I am using drop down menus (options) and basically trying to have a minimum age of 18 years old. I have tried several different code methods of trying to receive an alert to tell the user that they are not old enough. I have included the other code I was working with but just commented it out. function checkForm(){ var min_age = 18; //var today = new Date(); //var CurrYear = today.getFullYear(); //var CurrMonth = today.getMonth() + 1; var year = parseInt(document.forms["Voter"]["year"].value); var month = parseInt(document.forms["Voter"]["month"].value) - 1; var day = parseInt(document.forms["Voter"]["day"].value); var theirDate = new Date((year + min_age), month, day); var today = new Date; if ((today.getdate() - theirDate.getdate()) < 0) { alert("You must be at least 18 years old to vote!"); return false; } else { return true; } } The rest of the code/page is a form that has day with drop menu (1-31), month with drop menu (1-12), year drop menu (1900-2004). Problem is the user can select the menu items but when the form is submitted if they are not 18 years old or older it is supposed to alert them. I have tried different methods to code this and can't seem to find the right combination to make it work, any suggestions would be greatly appreciated. if(document.Voter.Name.value=="") [/code]
VIEWS ON THIS POST

74

Posted on:

Wednesday 21st November 2012
View Replies!

Odd .js problem

So I have a .js file that changes a div on my html file. When I update the .js file it seems to run the program in the updated form, the problem is that when it changes the innerHTML of the div it is changing it to an old setup. The way I know it is running my new program is the variables have adjusted to the new programming, they are just showing up in what is a very old layout. I have restarted my computer. Deleted the cache in two different ways. I even disabled the cache for a little. I even tried running it on IE, same problem. If you have any questions or need some clarification please post. As it is I can not proceed, so I will watch posts pretty frequently for a while.
VIEWS ON THIS POST

133

Posted on:

Wednesday 21st November 2012
View Replies!

remove a list item

I would like to know how can i remove a selected item from an ordered list which was dynamicaly created\t Thanking you in advance!!
VIEWS ON THIS POST

301

Posted on:

Thursday 22nd November 2012
View Replies!

.animate question/help

So, I've built this navigation bar so far and I'm curious if it's even possible to achieve what I'm thinking. Currently, when you hover over each of the links they drop down (padding is increased). Now, what I'm curious in doing is if you hover over say "test1", test2-4 also drop with it but in the padding that has been created from the drop down, "test1" information shows up. owing the user to click or read whatever information is in there. Also, if the user would like to, they can move their mouse to test2 and everything would animate (opacity, this I can do I think) to whatever is in the test2 field, test3 doing the same and so on. I haven't had much success with this, I've created a completely separate panel before, but that didn't exactly work or I wasn't doing it correctly. Here is what I've been working on, ANY help would be appreciated!
VIEWS ON THIS POST

129

Posted on:

Thursday 22nd November 2012
View Replies!

layering with css, but an extension of my jscript question

http://www.youraddre...m/scripts.html# Untitled Document Effect.divSwap = function(element,container){ var div = document.getElementById(container); var nodeList = div.childNodes; var queue = Effect.Queues.get('menuScope'); if(queue.toArray().length
VIEWS ON THIS POST

169

Posted on:

Friday 23rd November 2012
View Replies!

Help_A2 ICT

Hi im currently studying ict a level and we have to design a mulitmedia product in flash, i am a complete newbie to flash, and im wondering how you make a small text box appear on a mouseover a piece on text
VIEWS ON THIS POST

145

Posted on:

Saturday 24th November 2012
View Replies!

submit button working fine in i.e but giving error?

Thanks a lot Graphix
VIEWS ON THIS POST

254

Posted on:

Saturday 24th November 2012
View Replies!

Jquery ajax post problem

, I am doing simple Jquery ajax post to php and I am very new to three languages. Any suggestion or guidance. I have two iframes 1)iframe 1 is Navigation menu(loaded with flash menu). 2)iframe 2 is load the web page. When I click the navigation menu the corresponding web page loaded. In one part, when I clicked the navigation menu the login_reg.php page open in page_load. The login_reg page has two parts of form, 1) In one, registration process is done 2) In another, login is done. When I submit the login_form, it check the login and password.if it success, both parent iframes should be reloaded by corresponding src attribute, MY problem: 1) But sometimes it getting refresh without any changes and. 2) Mozilla, safari it doesnt works and just page is get refreshed. My Jquery and ajax script: $(document).ready(function(){ $("form#login_form").submit(function() { alert('this method is called'); var user_id=$('#user_id').val(); var p_word=$('#p_word').val(); if(user_id.length >= 4 && p_word.length>=4) { $.ajax({ type: "POST", url: "login-exec.php", data: "user_id="+ user_id + "&p_word="+p_word, success: function(msg){ alert('it entered the message'); if(msg == 'OK') { parent.load_right('pub@lic_profile/@_profile/all_@_all/flashmo_203_modified.swf'); parent.load_left('pub@lic_profile/@_profile/all_@_all/horizontal_menu/flashmo_114_horizontal_03.swf'); } else if(msg=='NOT') { alert('the message is alert is not OK'); } } }); } else { $("#status1").html('The username should have at least 4 characters.'); $("#username").removeClass('object_ok'); $("#username").addClass("object_error"); } }); PHP script:
VIEWS ON THIS POST

178

Posted on:

Saturday 24th November 2012
View Replies!

Scoping anonymous functions

Hi I have a loop looping through an "band" object array. I am assigning a anonymous functions for the object property(actually dragging) for (var j=0;j
VIEWS ON THIS POST

110

Posted on:

Saturday 24th November 2012
View Replies!

Need help with figuring out how to grab the videos?

I am trying to download the full videos behind this flash player. Please investigate.
VIEWS ON THIS POST

144

Posted on:

Saturday 24th November 2012
View Replies!

Any advice on how to build a simple javascript form?

Any help would be appreciated
VIEWS ON THIS POST

230

Posted on:

Saturday 24th November 2012
View Replies!

Help regarding comparison of String in JS

How to do this type of comparison. Say i have a variable with a word "ABCDEF" and i want to check the combination "DEF" exists in it or not how do i do I want to make a simple comparison test.. Some friend suggested me the "substring" function but that works only in JSP i hope Please help me out!
VIEWS ON THIS POST

203

Posted on:

Saturday 24th November 2012
View Replies!

How to move a button using Javascript on MouseOver

hi, I want to move a button to new location at the mouseOver event in JavaScript.. Please have a look at my code below. function move() { b1.style.position = "relative"; setTimeout(b1.style.left = 100,1000) } Im able to move the button to the new location but its moving very fast,I want to move the button slowly.Much like when we use .hide("slow") I have tried using setTimeout(b1.style.left = 100,1000) but its not working.. Please guide how to do it
VIEWS ON THIS POST

129

Posted on:

Sunday 25th November 2012
View Replies!

Slideshow Messed-up

[IMG]http://i1235.photobucket.com/albums/ff429/rakwel10/pix.jpg[/IMG] The picture above may not be that clear but this is my website created in Wordpress. As you can see, the slideshow is messed up. When the first slide will show up, the next slide is showing too under the first slide. When I try to zoom out the website and refresh it, its getting arranged. What do you think is the problem
VIEWS ON THIS POST

169

Posted on:

Sunday 25th November 2012
View Replies!

lost some of code ? cant fix it

Ive accidently deleted something needed in the body I think for this code, but I cannot work out what it needs. I think the descarea div is missing Can you help me rewriteit function Request() { if (window.XMLHttpRequest ) { return new XMLHttpRequest(); } else if (window.ActiveXObject) { try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { return false; } } } } function SetDescPos(e) { if (typeof event!='undefined') { e=new Object(); e.pageX=event.clientX+document.body.scrollLeft; e.pageY=event.clientY+document.body.scrollTop; } descarea=document.alldocument.all.miniTopic:document.getElementById("miniTopic"); descarea.style.left=e.pageX+2; descarea.style.top=e.pageY+2; } function GetTopic(url,tTitle) { maxlen=300; if (typeof saveDesc=='undefined') { saveDesc=[]; } if (typeof saveDesc[url]!='undefined') { descarea=document.alldocument.all.miniTopic:document.getElementById("miniTopic"); descarea.innerHTML=""+tTitle+""+saveDesc[url]; descarea.style.display=''; } else { url=url; tTitle=tTitle; descReq=Request(); descReq.open("http://inny.ipbfree.com/GET",url); descarea=document.alldocument.all.miniTopic:document.getElementById("miniTopic"); descarea.innerHTML="Loading Topic Preview...Please Wait... "; descarea.style.display=''; descReq.onreadystatechange=function() { if (descReq.readyState==4) { txt=descReq.responseText; txt.match(/
VIEWS ON THIS POST

190

Posted on:

Sunday 25th November 2012
View Replies!

how to restrict user from click another tabs menu

Hi , I have 3 horizontal tabs menus with different form to let user key in some infor to the text fields. When user 1st time access this page, all fields are blank. But if user want to go to the second tab, user must key in some infor at the 1st tabs form. How do I check if user didn't key in anything in the 1st tabs form I want to force user to key in the 1st tab's form in order to allow user to click the second tab form and 3rd tab form. What I want is if user didn't key in anything at the 1st tab's form, an alert will prompt out and tell the user to key in the text in the textfield at 1st tab form and save the data into mysql DB. Or else he can't even pressed the second tab form or 3rd tab's form. How should I proceed with this requirement. I using yui tabview to show the tab menu. the form is within the same page. Here is the sample of how my tab menu look like: http://developer.yahoo.com/yui/examp...rommarkup.html So when user click 1st tab and then to next tab menu, i need to verify if user is allow to click 2nd tab. Or else force user back to 1st tab. Each tab will have a content. I am using php and mysql for data storage. I think of using javascript to do this but my javascript is knowledge is a bit crappy.
VIEWS ON THIS POST

101

Posted on:

Sunday 25th November 2012
View Replies!

form verification using regular expressions

I keep getting an error that says item is null. I'm a little lost because once I got my regExp to start working this actually worked for a little bit. When I came back i was getting an error. I have no idea what i did. var creditExp = /^([345])(\d{3})\-(\d{4})\-(\d{4})\-(\d{4})$/; var creditNumber = document.getElementById("creditnum").value; var item = creditExp.exec(creditNumber); document.getElementById("creditnum").value = item[1] + item[2] + "-" + item[3] + "-" + item[4] + "-" + item[5]; if (item[1] == 4 && document.getElementById("card1").checked == true) { return true; } else if (item[1] == 5 && document.getElementById("card2").checked == true) { return true; } else if (item[1] == 3 && document.getElementById("card3").checked == true) { return true; } else { alert("You must enter a valid credit card number."); document.getElementById("creditnum").focus(); return false; } var billingName = document.getElementById('creditname').value; if (billingName == null || billingName == "") { alert("You must enter your first name as printed on your credit card!"); document.getElementById('creditname').focus(); return false; }
VIEWS ON THIS POST

219

Posted on:

Monday 26th November 2012
View Replies!

Problem with height of a page in browsers

Using JQuery and CSS with javascript happens a very strange thing...i'm doing a site where every page has 5 DIV in vertcal, called "div1", "div2" and so on. Every page can have a different height, so i use the following script: $(document).ready(function() { var sH = $(document).height() + 'px'; for (i=1; i
VIEWS ON THIS POST

88

Posted on:

Monday 26th November 2012
View Replies!

Help me guys

HELLO May peace on you...i am stuck in a problem.i had a loading image that appears while i submit the form but the problem is that my page is not redirect to next page.here is my code please help me.... Untitled Document $(document).ready(function(){ $('.loader').hide(); $('#test').click(function(){ $('.loader').show(); return false; }); }); .loader{ background:url(loading-small.gif) no-repeat; height:32px; width: 32px; display:inline-block; } Name: Age:
VIEWS ON THIS POST

31

Posted on:

Monday 26th November 2012
View Replies!

Sequential Numbers in Adobe Acrobat

I am trying to create an Acrobat form that a user fills out. Each form must have a unique number and once a form is used, the next number must be in sequence from the previous one. I think a dynamic stamp will work, but I don't know anything about the Java Script that goes with it. Does anyone know how to do this or where I start
VIEWS ON THIS POST

207

Posted on:

Monday 26th November 2012
View Replies!

slide show Problemo

all, Just took a JavaScript class, where they didn't teach us anything about slide shows. Now I have a client and I promised them a slide show on their website. I made an external Js file, and Firefox debugger keeps on giving me this error: document[place].src is undefined. Here's the code from the external .js, again really unfamiliar with this so I based it off example code I found: var num=0; var imgName="pictures/"; var slideImg= new Array(); slideImg[0]=new imageItem(imgName+"1.jpg"); slideImg[1]=new imageItem(imgName+"2.jpg"); slideImg[2]=new imageItem(imgName+"3.jpg"); function imageItem(image_location) { this.image_item = new Image(); this.image_item.src = image_location; } function get_ImageItemLocation(imageObj) { return(imageObj.image_item.src) } function getNextImage() { if(num < slideImg.length) { var new_img=get_ImageItemLocation(slideImg[num]); return(new_img); } else { num=1; } } function switchImage(place) { var new_img = getNextImage(); document[place].src=new_img; setTimeOut(switchImage(place)); } The problem should be in the last function switchImage().
VIEWS ON THIS POST

199

Posted on:

Monday 26th November 2012
View Replies!

Getting Index of a Form Element

I'm trying to determine a better method of finding the index value of a form element. I need to find it because the JavaScript validation class has a function for validating a single form element, but it requires that the index number of the element in the form be passed in. Currently I am accomplishing this by a function that I wrote which I call for each field I want to validate: function getIndex(element) { for (var i=0; i
VIEWS ON THIS POST

66

Posted on:

Monday 26th November 2012
View Replies!

Dowloading files from servers opens new window in?

In my project im using CGI and c++ in the server. When ever i download files from the server, IE 8 opens a window for every file downloaded. Then it does not close that damn new window. Please help me remove these extra windows.
VIEWS ON THIS POST

180

Posted on:

Monday 26th November 2012
View Replies!

Call dynamically created form items.

I want to be able to access whatever the user types into my testCreation.html in a session created in testCheck.php. I then want that session to be accessed by testView.php. I can't seem to get to that point so any help is grealy appreciated. testCreation.html: Untitled Page var questionNum = 1; function include(file) { if (document.createElement && document.getElementsByTagName) { var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.setAttribute('type', 'text/javascript'); script.setAttribute('src', file); head.appendChild(script); } else { alert('Your browser can\'t deal with the DOM standard. That means it\'s old. Go fix it!'); } } function includes() { include("testCheck.php"); } function addQuestion() { var paragraph = document.createElement("p"); document.getElementById("divRadiolist").appendChild(paragraph); var newQuestion = document.createTextNode(questionNum + ". \n"); document.getElementById("divRadiolist").appendChild(newQuestion); document.getElementById("divRadiolist").appendChild(paragraph); var myText = document.createElement("input"); myText.id = "text" + questionNum; myText.setAttribute("type", "text"); myText.setAttribute("name", "question"+questionNum); myText.style.width = "1000px"; myText.style.height = "25px"; document.getElementById("divRadiolist").appendChild(myText); questionNum++; } testCheck.php: testView.php: - Kind
VIEWS ON THIS POST

259

Posted on:

Monday 26th November 2012
View Replies!

how to change id by adding new row..

I think i got the solution..!! we can change id even in CloneNode.>!! :) . .
VIEWS ON THIS POST

128

Posted on:

Monday 26th November 2012
View Replies!

drop down navigation errors

, Im having trouble getting a button to link to a banquet page, I know its probably somethign simple but i cant seem to figure it out DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> New Document /* Sample CSS definition for the example list. Remove if deed */ .dropmenudiv{ position:absolute; background-color:#99CDFF; border:1px solid #04255A; font:bold 16px timesnewroman; color:#04255A; line-height:25px; z-index:100; text-align:center; } .dropmenudiv a{ display: block; text-indent: 1px; border: 1px solid #04255A; padding: 0px 2; text-decoration: none; font-weight: bold; color:#04255A; text-align:center; } .dropmenudiv a:hover{ /*hover background color*/ background-color: #99CDFF; display: block; text-indent: 1px; border-bottom: 1px solid #04255A; padding: 0px 2; text-decoration: none; font-weight: bold; color:#04255A; } .navlist { font-family:verdana; font-weight:bold; font-size:12px; color: #a4a4a4; line-height:25px; text-decoration:none; } .navlist a:hover { font-family:Sans Serif; font-weight:bold; font-size:12px; color: #ff0000; line-height:25px; text-decoration:none; } .anylinkcss{ position:absolute; visibility: hidden; border:1px solid gray; border-bottom-width: 0; font:normal 11px Sans Serif; line-height: 18px; z-index: 100; background-color: white; width: 205px; } .anylinkcss a{ color: black; width: 100%; display: block; text-indent: 3px; border-bottom: 1px solid gray; padding: 1px 0; text-decoration: none; font-weight: bold; text-indent: 5px; } .anylinkcss a:hover{ /*hover background color*/ background-color: #F8FBBD; color: black; } var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds) var enableanchorlink=0 //Enable or disable the anchor link when clicked on (1=e, 0=d) var hidemenu_onclick=1 //hide menu when user clicks within menu (1=yes, 0=no) var horizontaloffset=1 //horizontal offset of menu from default location. (0-5 is a good value) /////No further editting needed var ie5=document.all var ns6=document.getElementById&&!document.all function getposOffset(what, offsettype){ var totaloffset=(offsettype=="left") what.offsetLeft : what.offsetTop; var parentEl=what.offsetParent; while (parentEl!=null){ totaloffset=(offsettype=="left") totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop; parentEl=parentEl.offsetParent; } return totaloffset; } function showhide(obj, e, visible, hidden){ if (ie5||ns6) dropmenuobj.style.left=dropmenuobj.style.top=-500 if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover") obj.visibility=visible else if (e.type=="click") obj.visibility=hidden } function iecompattest(){ return (document.compatMode && document.compatMode!="BackCompat") document.documentElement : document.body } function clearbrowseredge(obj, whichedge){ var edgeoffset=0 if (whichedge=="rightedge"){ var windowedge=ie5 && !window.opera iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15 dropmenuobj.contentmeasure=dropmenuobj.offsetWidth if (windowedge-dropmenuobj.x-obj.offsetWidth < dropmenuobj.contentmeasure) edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+(horizontaloffset*2) //no space to the right of page Move menu over to the left } else{ var topedge=ie5 && !window.opera iecompattest().scrollTop : window.pageYOffset var windowedge=ie5 && !window.opera iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18 dropmenuobj.contentmeasure=dropmenuobj.offsetHeight if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move menu up edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight if ((dropmenuobj.y-topedge)
VIEWS ON THIS POST

97

Posted on:

Tuesday 27th November 2012
View Replies!

need some help new to javascript

could someone take a look at this new to javascript
VIEWS ON THIS POST

161

Posted on:

Tuesday 27th November 2012
View Replies!

HELP! With Javascripts Pop-Up Window

Hi - I am currently using a Javascript for a pop up window that enlarges a thumbnail picture. I wish the POP UP window image to be LINKABLE - that is on mouseover of IT, goto a new window URL - Any help would be extremely appreciated!!! My Current URL for this project is: www.webdesign.johnrandazzo.net/portfolio.htm (then mouseover one of the designs to pop up the window in question) CURRENT JAVASCRIPT CODE:
VIEWS ON THIS POST

174

Posted on:

Tuesday 27th November 2012
View Replies!

Javascript validation not working with form of multipart/form-data - JavaScript Help

Hi ,Been stuck for a few days with this scenario.Any helpThe alert box appears on an error.But the submitting won't stop.The details are submitted and the form is processed.Any help is greatly appreciated... tinyMCE.init({ // General options mode : "textareas", theme : "simple" }); function MM_openBrWindow(theURL,winName,features) { window.open(theURL,winName,features); } function err_check(){ var email = document.getElementById('to_email').value; if(email.length==0){ alert('Please Enter Email Address'); return false; } var AtPos = email.indexOf("@") var StopPos = email.lastIndexOf(".") if (AtPos == -1 || StopPos == -1) { alert("Please Enter Valid Email Address"); document.getElementById('email').focus(); return false; } email = document.getElementById('cc_email').value; if(email.length != 0){ var AtPos = email.indexOf("@") var StopPos = email.lastIndexOf(".") if (AtPos == -1 || StopPos == -1) { alert("Please Enter Valid Email Address"); document.getElementById('email').focus(); return false; } } var answer = confirm ("Send E-Mail"); if (!answer){ return false; } } body, table, td, th{ background-color:#CCCCCC; font-family: Arial; font-size:14px; } .que{ font-weight:bold; }
VIEWS ON THIS POST

83

Posted on:

Tuesday 27th November 2012
View Replies!

performance on my js script - JavaScript Help

, So this is my problem. I basically have 2 scripts running. one controls a video (through quicktime plug in) and the second controls a menu. The script that controls the menu does animation. When the movie and the menu animation run at the same time, the menu animation moves to a crawl. no idea how to fix thisHere is my code var episodes = [ ['Redavenger and Friends', [ ['Episode 0', 27, 4, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 1', 27, 36, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 2', 27, 24, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 3', 27, 14, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 4', 27, 10, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 5', 27, 40, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 6', 27, 78, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 7', 27, 64, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'] ] ], ['Season 0', [ ['Episode 8', 27, 4, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 9', 27, 84, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 10', 27, 82, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 11', 27, 50, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 12', 27, 88, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 13', 27, 56, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 14', 27, 50, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 15', 27, 68, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'] ] ] ]; // functions function isArray(obj){ return Object.prototype.toString.apply(obj) === '[object Array]'; } // prototypes String.prototype.divs = function(insert){ if(typeof insert != 'undefined'){insert = " "+insert+" ";}else{insert = "";} return '' + this + ''; } String.prototype.img = function(src, insert){ if(typeof insert != 'undefined'){insert = " "+insert+" ";}else{insert = "";} if(typeof src != 'undefined') return ""; } Number.prototype.pad = function(){ if(this < 10){return '0' + this;} return this; } //MENU FILL menu = new Object(); menu.season = function(){ var finalMenu=""; var item=""; for(var z=0; z distance){theDiv.scrollLeft -= 1;} if(divStart < distance){theDiv.scrollLeft += 1;} }else{ divStart = theDiv.scrollTop; if(divStart > distance){theDiv.scrollTop -= 1;} if(divStart < distance){theDiv.scrollTop += 1;} } if(divStart == distance || scrolling.lastValue == divStart){ clearInterval(Timer); if(distanceStart == 0 && direction == 'x'){scrolling.fade('back');}else{scrolling.fade('back', 'true');} scrolling.process = false; scrolling.lastValue = null; }else{ scrolling.lastValue = divStart; } } distance *= menu.divSize(divId, direction); Timer = setInterval("animation()", speed); } scrolling.process = false; scrolling.fade = function(id, reverse){ var value = 0; start = function(id, value){ testObj = document.getElementById(id); testObj.style.opacity = value/100; testObj.style.filter = 'alpha(opacity=' + value*10 + ')'; if(value == 100){clearInterval(Timer2);} } if(reverse != 'true'){Timer2 = setInterval(function(){start(id, ++value)}, 15);}else{value=100;Timer2 = setInterval(function(){start(id, --value)}, 15);} } // video controller time = {hours: 0, mins: 0, secs: 0, state: 'notStarted'} time.set = function(){ ss = (document.qtmovie_embed.GetTime() / time.scale); time.percent = Math.round(100 * (ss / time.duration)); time.hours = Math.round((ss / 3600) - .5); time.mins = Math.round(((ss / 60) - .5)-(time.hours * 60)); time.secs = Math.round(ss-(Math.round((ss/60)-.5)*60)); } time.update = function(){ time.set(); newTime = time.hours.pad() + " : " + time.mins.pad() + " : " + time.secs.pad(); document.getElementById('pointer').style.width = Math.round(((time.percent/100) * time.inFrames)-.5) + "px"; document.getElementById('test').innerHTML = newTime; document.getElementById('test2').innerHTML = time.duration.pad(); } function loaded(){ time.duration = document.qtmovie_embed.GetDuration() / document.qtmovie_embed.GetTimeScale(); time.scale = document.qtmovie_embed.GetTimeScale(); time.inFrames = menu.divSize('progresscontainer', 'x'); var finalTimeLine = ""; for(var i = 1; i = 256){current = 217;} document.qtmovie_embed.SetVolume(current + 39); }else{ if((current - 39)= 217) {document.getElementById('vol-6').style.backgroundImage = 'url(images/vol_6.png)'}else{document.getElementById('vol-6').style.backgroundImage = 'url(images/emvol_6.png)';} if(current >= 178) {document.getElementById('vol-5').style.backgroundImage = 'url(images/vol_5.png)'}else{document.getElementById('vol-5').style.backgroundImage = 'url(images/emvol_5.png)';} if(current >= 139) {document.getElementById('vol-4').style.backgroundImage = 'url(images/vol_4.png)'}else{document.getElementById('vol-4').style.background = 'none'} if(current >= 100) {document.getElementById('vol-3').style.backgroundImage = 'url(images/vol_3.png)'}else{document.getElementById('vol-3').style.background = 'none'} if(current >= 61) {document.getElementById('vol-2').style.backgroundImage = 'url(images/vol_2.png)'}else{document.getElementById('vol-2').style.background = 'none'} if(current > 0) {document.getElementById('vol-1').style.backgroundImage = 'url(images/vol_1.png)'}else{document.getElementById('vol-1').style.background = 'none'} document.getElementById('test3').innerHTML = document.qtmovie_embed.GetVolume().pad(); } function myAddListener(obj, evt, handler, captures){ if(!captures){captures=false;} if ( document.addEventListener ) obj.addEventListener(evt, handler, captures); else obj.attachEvent('on' + evt, handler); // IE requires this form } function setup(){ // register for events on the element, our handler will be triggered even if // the browser uses the because events pass through the parent element var plug = document.getElementById('qtmovie_embed'); if ( null == plug ){ alert("QT plug-in not instantiated on load event\t"); return; } loaded(); myAddListener(plug, 'qt_play', progress); myAddListener(plug, 'qt_pause', hasStoped); myAddListener(plug, 'qt_ended', hasStoped); } .div1{ width: 60%; float: left; border: 1px dashed #000000; } .div2{ width: 35%; float: left; border: 1px dashed #000000; } .menunav{ background: #da1b1b; height: 38px; width: 317px; } .menunav .menutitle{ width: 90%; text-align: left; margin: 5px; font-family:'Comic Sans MS', 'san sarif', 'Arial'; font-size:25px; font-weight:bold; line-height: 38px; } .screennav{ background: #da1b1b; font-family:'Comic Sans MS', 'san sarif', 'Arial'; height: 38px; width: 317px; } .screennav .back{ margin-left:5px; opacity: 0; } .menu{ position: relative; height: 248px; width: 307px; border: 5px solid #da1b1b; overflow: hidden; } .episodes{ position: absolute; top: 0px; left: 307px; overflow: hidden; height: 248px; width: 307px; } .episodes .episodelist{ height: 248px; } .episodes .episodelist .episode{ height: 62px; width: 100%; border-bottom: dashed 1px #000000; font-size: 8px; } .episodes .episodelist .episode .image{ float: left; width:71px; height:62px; background: center no-repeat; margin-left: 5px; margin-right: 5px; } .episodes .episodelist .episode .episodeTitle{ float: left; width: 100px; text-align: left; font-size: 15px; } .episodes .episodelist .episode .container{ width: 100px; height: 55px; margin-right: 25px; overflow: hidden; float: left; } .episodes .episodelist .episode .container2{ width: 75px; margin-top: 7px; float: left; } .episodes .episodelist .episode .container2 .item_options{ padding-left: 20px; margin-bottom: 8px; height: 10px; line-height: 10px; float: left; clear: left; background: inherit; } .episodes .episodelist .episode .container .score{ float: left; clear: left; margin-left: -2px; height: 20px; width: 100px; background: url(mini-starrating.gif) left top repeat-x; } .episodes .episodelist .episode .container .score .rating{ float: left; height: 20px; width: inherit; background: url(mini-starrating.gif) left center repeat-x; } .episodes .episodelist .episode .container .views{ float: left; clear: left; width: 100px; } .episodeDetail{ position: absolute; top: 0px; left: 614px; overflow: hidden; height: 248px; width: 307px; } .episodeDetail .header{ border-bottom: 1px dashed #000000; height: 62px; } .episodeDetail .header .episode_info{ width: 220px; float: right; } .episodeDetail .header .episode_info .episode_title{ font-size: 15px; font-weight: bold; } .episodeDetail .header .episode_info .episode_season{ font-size: 8px; margin-bottom: 8px; } .episodeDetail .header .episode_info .score{ float: left; clear: left; margin-left: -2px; height: 20px; width: 100px; background: url(mini-starrating.gif) left top repeat-x; } .episodeDetail .header .episode_info .rating{ float: left; height: 20px; width: inherit; background: url(mini-starrating.gif) left center repeat-x; } .episodeDetail .header img{ margin-top: 5px; margin-left: 5px; margin-right: 5px; } .episodeDetail .episode_description{ margin: 0px 5px 0px 5px; height: 135px; overflow: hidden; } .episodeDetail .container{ width: 110px; margin-top: 4px; margin-left: auto; margin-right: auto; } .episodeDetail .container .button{ float: inherit; margin-top: -5px; height: 48px; width: 48px; } .seasons{ position: absolute; top: 0px; left: inherit; height: 248px; width: 307px; text-align: center; font-family:'Comic Sans MS', 'san sarif', 'Arial'; font-size:8px; font-weight:bold; line-height: 30px; } .seasons div{ border-bottom:1px dashed #000000; } .seasons div:hover, .episodes .episodelist div:hover{ background: #fcff01; } /* controlls */ .progresscontainer{ position: absolute; width:448px; height:42px; left:99px; top:5px; background: url(images/progressbar.png) repeat-x; } .timeline{ height: 42px; width: 100%; position: relative; } .timeline div{ width: 1px; height: 42px; float: left; } .pointer{ position: absolute; top: 0px; width: 1px; height: 42px; background: url(images/loadedprogressbar.png) repeat-x; } .controllbar { position: relative; width:644px; height: 67px; } .controllbar .stop { background: url(images/stop.png) no-repeat; position:absolute; left:0px; top:0px; width:46px; height:47px; } .controllbar .play { background: url(images/play.png) no-repeat; position:absolute; left:46px; top:0px; width:40px; height:47px; } .controllbar .frameleft { background: url(images/frameleft.png) no-repeat; position:absolute; left:86px; top:0px; width:13px; height:47px; } .controllbar .frametop { background: url(images/frametop.png) no-repeat; position:absolute; left:99px; top:0px; width:455px; height:5px; } .controllbar .pause { background: url(images/pause.png) no-repeat; position:absolute; left:554px; top:0px; width:45px; height:47px; } .controllbar .vol_plus { background: url(images/vol_plus.png) no-repeat; position:absolute; left:599px; top:0px; width:45px; height:24px; } .controllbar .frameright { background: url(images/frameright.png) no-repeat; position:absolute; left:547px; top:5px; width:7px; height:42px; } .controllbar .vol-7 { background: url(images/vol_7.png) no-repeat; position:absolute; left:599px; top:24px; width:45px; height:4px; } .controllbar .vol-6 { background: url(images/vol_6.png) no-repeat; position:absolute; left:599px; top:28px; width:45px; height:3px; } .controllbar .vol-5 { background: url(images/vol_5.png) no-repeat; position:absolute; left:599px; top:31px; width:45px; height:3px; } .controllbar .vol-4 { background: url(images/vol_4.png) no-repeat; position:absolute; left:599px; top:34px; width:45px; height:3px; } .controllbar .vol-3 { background: url(images/vol_3.png) no-repeat; position:absolute; left:599px; top:37px; width:45px; height:3px; } .controllbar .vol-2 { background: url(images/vol_2.png) no-repeat; position:absolute; left:599px; top:40px; width:45px; height:3px; } .controllbar .vol-1 { background: url(images/vol_1.png) no-repeat; position:absolute; left:599px; top:43px; width:45px; height:3px; } .controllbar .vol_minus { background: url(images/vol_minus.png) no-repeat; position:absolute; left:599px; top:46px; width:45px; height:21px; } .controllbar .framebottom { background: url(images/framebottom.png) no-repeat; position:absolute; left:0px; top:47px; width:599px; height:20px; } /* playlist */ .playlist{ width: 100%; height: 80px; border: 1px dashed #000000; float: left; } .playlist .option{ width: 70px; height: 70px; margin-top: 4px; margin-left: 10px; float: left; border: 1px dashed #000000; } Home Back
VIEWS ON THIS POST

117

Posted on:

Tuesday 27th November 2012
View Replies!

question: Javascript link to start another javascript

hi im new to this ive got a question is it possible to link an item to start another javascript possibly with an on click funktion so that the javascript only starts once you click an item on the navigation bar $(document).ready(function(){ $.uiPro({ leftMenu : { 'item1' : { 'label' : 'Item One', , */
VIEWS ON THIS POST

147

Posted on:

Wednesday 28th November 2012
View Replies!

Image effect transition problem

Hi I've been working on a slideshow where the user could apply image effects to the slide(s) while the slideshow running. Now the problem is when I apply effect to the image it works but when the loops starts again the image effect show on previous image. I do understand I can't describe the question properly, for exact detail of my question pls have a look at the detail. Slideshow link
VIEWS ON THIS POST

134

Posted on:

Thursday 29th November 2012
View Replies!

Format : [LastName, FirstName MiddleInitial.] Regular Expression

I hate regular expressions, I have to say that. Anyway, I want to create a regular expression that checks if a string has this format: [FirstName], [LastName] [MiddleInitial]. I tried doing it like this : /\w+, \w+ [a-zA-Z]\./.test(this.value) failure. Can help
VIEWS ON THIS POST

114

Posted on:

Thursday 29th November 2012
View Replies!

comp.lang.javascript FAQ - Quick Answers 2008-01-21

comp.lang.javascript FAQ - Quick Answers- 9.88 - 2007-10-12 1 meta-FAQ meta-questions 2 comp.lang.javascript tips 2.1 Which newsgroups deal with javascript 2.2 What questions are off-topic for clj 2.3 What do I have to do before posting to clj 2.4 Why ...
VIEWS ON THIS POST

130

Posted on:

Friday 30th November 2012
View Replies!

xmldom getAttribute firefox problem

Hi all I am trying to get a url attribute from an xml node: I can do this in IE with the following code: var newDom = xmlhttp.responseXML; var x = newDom.getElementsByTagName("item"); var urlNode = ...
VIEWS ON THIS POST

142

Posted on:

Friday 30th November 2012
View Replies!

Scriptaculous - Sortable.create() bug

Im using Scriptaculous v1.7 to perform sortable drag drop. My display uses: Sortable.create('DocumentContainer_1',{tag:'div',onUpdate:SortUpdate, handle:'Gripper',constraint:false,scroll:window}); There are about 5 div blocks with gripper hanldes next to them. Drag drop sorting works fine. Later i perform an AJAX update within the child ...
VIEWS ON THIS POST

82

Posted on:

Friday 30th November 2012
View Replies!

move square in a route

>>>I need to move the coloured little square trought the 4lines.now i know they move just in the first line and take a solution using parent node and cellIndex to move to alla lines.example: if u start and u trow ...
VIEWS ON THIS POST

128

Posted on:

Friday 30th November 2012
View Replies!

Wanted: young AJAX programmer in London

Are you a young programmer with some experience in javascript, XML, HTML living in London Are you interested in a idea for an internet start-up Then respond to the email adress above. No spam. Dirk nachbar dot unimatch at gmail ...
VIEWS ON THIS POST

81

Posted on:

Friday 30th November 2012
View Replies!

For ... in loop over array not working as expected

I created this page and script to experiment with Javascript's constructor and prototyping, as well as the for...in loop, which has caused me trouble before. I am having a problem with the for loop: for(var s in this.sArr). I would like it to iterate over every entry in sArr, which is what I thought it would do, but s just assumes the value of each array index. If there are three strings added to sArr in the strings object, 0 1 2 just gets printed out. What is the correct way to iterate over every element of an array string Test function stringStore() { this.sArr = []; } stringStore.prototype.addString = function(s) { alert(s); this.sArr.push(s); } stringStore.prototype.return = function() { sbuilder = ""; for(var s in this.sArr) { alert(s); sbuilder += s; sbuilder += "\n"; } return sbuilder; } strings = new stringStore(); function addString() { strings.addString(document.getElementById("input").value); } function print() { document.getElementById("output").value = strings.return(); } input: add output: print
VIEWS ON THIS POST

204

Posted on:

Sunday 23rd December 2012
View Replies!

Passing Variables

I'm writing a non-refreshing registration page using a mix of jQuery and regular Javascript. I gather the data from input fields, store it in variables, and then pass the variables to another function which use the jQuery $.post function for ajax to send the variables to a PHP script that submits them to a MySql database. The problem is the PHP script doesn't seem to be getting any data at all. Now I think my problem comes up when I pass the variables to the function register. function getContent() { //Get Values for each form field username=document.getElementById('user').value; password=document.getElementById('pass').value; verify=document.getElementById('verify').value; email=document.getElementById('email').value; register(username, password, email); } function register(username, password, email) { $('#registerForm').hide('medium'); $('#loading').show('medium'); $.post("register.php", {username: username, password: password, email: email}, function(data) { //code that deals with return data }); } Any ideas This post has been edited by Gamegoofs2: 05 April 2010 - 12:08 PM
VIEWS ON THIS POST

91

Posted on:

Sunday 23rd December 2012
View Replies!

Sortable Table Incorrectly sorting date column

Hi all, I'm fairly new to Javascript, and found a script here that allows for sortable tables in HTML, and for the most part, it works great. But with my date field, it either sorts alphabetically (Aug->Sept), or, if I change Names to Numbers (Jan=1, Feb=2, etc) the sort order becomes 1, 10, 2, 3, 4, 5, 6, 7, 8, 9 (I only have Jan-Oct dates). I think I have to tell my script to interpret my numbered dates as text, but like I said I'm new to JS and wouldn't know where to begin. Javascript (from http://www.webtoolki...html-table.html) // Javascript Document /** * * Sortable HTML table * http://www.webtoolkit.info/ * **/ function SortableTable (tableEl) { this.tbody = tableEl.getElementsByTagName('tbody'); this.thead = tableEl.getElementsByTagName('thead'); this.tfoot = tableEl.getElementsByTagName('tfoot'); this.getInnerText = function (el) { if (typeof(el.textContent) != 'undefined') return el.textContent; if (typeof(el.innerText) != 'undefined') return el.innerText; if (typeof(el.innerHTML) == 'string') return el.innerHTML.replace(//g,''); } this.getParent = function (el, pTagName) { if (el == null) return null; else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase()) return el; else return this.getParent(el.parentNode, pTagName); } this.sort = function (cell) { var column = cell.cellIndex; var itm = this.getInnerText(this.tbody[0].rows[1].cells[column]); var sortfn = this.sortCaseInsensitive; if (itm.match(/\d\d[-]+\d\d[-]+\d\d\d\d/)) sortfn = this.sortDate; // date format mm-dd-yyyy if (itm.replace(/^\s+|\s+$/g,"").match(/^[\d\.]+$/)) sortfn = this.sortNumeric; this.sortColumnIndex = column; var newRows = new Array(); for (j = 0; j < this.tbody[0].rows.length; j++) { newRows[j] = this.tbody[0].rows[j]; } newRows.sort(sortfn); if (cell.getAttribute("sortdir") == 'down') { newRows.reverse(); cell.setAttribute('sortdir','up'); } else { cell.setAttribute('sortdir','down'); } for (i=0;i
VIEWS ON THIS POST

55

Posted on:

Sunday 23rd December 2012
View Replies!

javascript: void(0)

java script: void(0) every time i click on some page this error comes in !!! and the site never opens !! help please !!!!
VIEWS ON THIS POST

142

Posted on:

Monday 24th December 2012
View Replies!

problem with document.form.submit

The following code must call MaPage.php and post to it the variable _strUserId when the user click on "click here" text. form and post works just fine with a submit button. javascript works very well (it can open a new window for example). but document.form1.submit() doesnt seem to work in the following code. when a user click on the text, nothing happens and the status bar mark: "error on page" Any ideas how to make this code to work
VIEWS ON THIS POST

150

Posted on:

Monday 24th December 2012
View Replies!

Javascript in [URL] tag

Can you make it so we can put "java script:...." inside [URL] tag Also why does it split the java$cript into 2 words when you post it This post has been edited by okyup: 09 November 2006 - 11:07 AM
VIEWS ON THIS POST

97

Posted on:

Monday 24th December 2012
View Replies!

jQuery UI tabs - JavaScript Help

HiI have the following code that has been rendered using php, but I am trying to use the jquery ui tabs, I have used the same code and files that are used on the demo of the tabs from the jquery site, but the tabs do not display. Trade-Bidz $(function() { $( "#tabs" ).tabs(); }); Logout Home Buying Selling Contact Us Terms My Trade-Bidz How It Works Search Items Make: Please select... MGRENAULT Model: Select Make Style: Ending Soon There are no lots completing today Other Selected Lots RENAULT SCENIC Expression 16V A Current Bid: £2133 Time Left: Countdown will go here View Lot MG ZR Current Bid: £1213 Time Left: Countdown will go here View Lot MG ZR Current Bid: £12 Time Left: Countdown will go here View Lot Buying Selling6 Watching0 Messages Profile Active Items You are Selling Reg NumberMake ModelEnd DateReserveCurrent BidCurrent High Budder0 RENAULT SCENIC Expression 16V A MPV 2011-09-20 3344.00 3434 42Ended You currently have not vehicle available for auction. To sell a vehicle click here You are currently not watching any items Trader Name:New Dealer Address:17 Stonehenge CroftBirminghamWest MidlandsB14 5PL Phone Number:01214745928 Feedback Feedback will appear here Any ideas why the tabs do not display
VIEWS ON THIS POST

98

Posted on:

Friday 28th December 2012
View Replies!