User Profile

Collapse

Profile Sidebar

Collapse
sdustinh
sdustinh
Last Activity: Mar 4 '08, 09:15 PM
Joined: Sep 24 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • sdustinh
    replied to Problem with replaceChild()
    FIXED IT!

    There was another div in the way. Thanks for the help!
    See more | Go to post

    Leave a comment:


  • sdustinh
    replied to Problem with replaceChild()
    Ooops, meant to correct that. When I try to run the script, I keep getting a DOM Exception 8 error. Which I believe is the same as the FF error of not being able to find the node.

    That doesn't make sense though, if I can use alert() and see that both of them come up with an object, shouldn't it work fine? I just can't seem to find what's causing the error.

    I thought maybe having the same id (which they do need to have,...
    See more | Go to post

    Leave a comment:


  • sdustinh
    started a topic Problem with replaceChild()

    Problem with replaceChild()

    First, here is the code.

    Code:
    function swapMP (theMPvalue) {
    	
    	if (theMPvalue !== "custom") {
    		return;
    	}
    	
    	var customMP = document.getElementById("part_mp");
    	var newCustomMP = document.createElement("input");
    	var thePartPopup = document.getElementById("partPopup");
    	
    	newCustomMP.setAttribute("id", "part_mp");
    ...
    See more | Go to post

  • sdustinh
    replied to String to number conversion
    Code:
    totalHDspace.innerHTML = parseInt(totalHDspace.innerHTML) + parseInt(sz)
    Because I was using a varible to pass it over, I had to add a parseInt() to that as well. I was getting random numbers from it because it was trying to convert it to hex or something.

    Thanks for the help!
    See more | Go to post

    Leave a comment:


  • sdustinh
    replied to String to number conversion
    Well, it's part of a larger script, so I'll put the relevant parts.

    [CODE=javascript]function updatePart (hd, sz, dispType) {
    var totalHDspace = document.getEle mentById(hd + '-total');
    //var totalHDspaceUp = document.getEle mentById(hd + '-total');

    switch (dispType) {
    case "update":
    totalHDspaceUp. innerHTML = parseInt(totalH DspaceUp.innerH TML) + sz;
    break;
    ...
    See more | Go to post

    Leave a comment:


  • sdustinh
    replied to String to number conversion
    Thanks for the reply.

    I've tried that, and for some reason it combines them like they are both strings.

    [CODE=javascript]var sz = 123;
    //theValue.innerH TML = 0;
    theValue.innerH TML = parseInt(theVal ue.innerHTML) + sz;[/CODE]

    So when it combines the two, it outputs "0123" rather than just "123" and it's the same when you try to do it again and add, say 10, it will spit out...
    See more | Go to post

    Leave a comment:


  • sdustinh
    started a topic String to number conversion

    String to number conversion

    I've got a number set up in my document like this

    Code:
    <span id="anID">0</span>
    and using javascript, I'm pulling the value of that using

    Code:
    var theValue = document.getElementById("anID");
    theValue.innerHTML = theValue.innerHTML + 10;
    What I'm trying to do is pull the value inside of the span tags (0), and then add it to something else (10) to spit...
    See more | Go to post

  • Sure...

    [CODE=html]<table id="hdpart-1">
    <tbody>
    <tr id="hdpart-1/1234">
    <td>Cell 1</td>
    <td>Cell 2</td>
    <td>Cell 3</td>
    <td>Cell 4</td>
    <td>Cell 5</td>
    <td>Cell 6</td>
    <td>Cell 7</td>
    <td>Cell 8</td>...
    See more | Go to post

    Leave a comment:


  • sdustinh
    started a topic JS works in Safari, but not FF - DOM error

    JS works in Safari, but not FF - DOM error

    I've got a problem with a script that is working perfectly in Safari, but won't work in FF. The error it spits out is



    Here is the function I'm trying to call...

    [CODE=javascript]function deletePartition (aPartID, partHDrive) {

    var oldPartHD = document.getEle mentById(partHD rive);
    var oldPartition = document.getEle mentById(aPartI D);

    oldPartHD.tBodi es[0].removeChild(ol dPartition);...
    See more | Go to post

  • sdustinh
    started a topic Handling an AJAX response

    Handling an AJAX response

    Hey, I'm looking to handle an XML response depending on what's sent. Better than I can explain it, here's an example...

    [CODE=javascript]function stateChanged () {
    if (xmlHttp.readyS tate == 4) {
    var xmlDoc = xmlHttp.respons eXML;

    if (xmlDoc.getElem entsByTagName(" error")) {
    alert('error');
    }
    }
    }[/CODE]

    Alright, the response will be either all...
    See more | Go to post

  • sdustinh
    replied to Locating a TD inside of a TR.
    Awesome, that got it! I had to rearrange somet things and it's not as pretty as I'd hoped... but it works now, so that's all that matters. Thanks a lot!
    See more | Go to post

    Leave a comment:


  • sdustinh
    replied to Locating a TD inside of a TR.
    Sorry, I was in a hurry and just didn't think about the title.

    I tried changing it over to that, but I still get an "Value undefined (result of expression theTableRow.get ElementsByTagNa me) is not an object" error.

    [CODE=javascript]var theTable = document.getEle mentById("hdpar t-" + (x+1));
    var theTableRow = theTable.tBodie s[0].getElementsByT agName("tr");
    var theTableCell...
    See more | Go to post

    Leave a comment:


  • sdustinh
    started a topic Locating a TD inside of a TR.

    Locating a TD inside of a TR.

    This is really simple, I almost feel bad for posting it.

    [CODE=javascript]var theTable = document.getEle mentById("hdpar t-" + (x+1));
    var theTableCell = theTable.tBodie s[0].getElementsByT agName("td");
    var theTableRow = theTable.tBodie s[0].getElementsByT agName("tr");[/CODE]

    instead of theTableCell pointing to every <td> tag in the table, I need it to only return the...
    See more | Go to post

  • sdustinh
    replied to DOM exception 8
    OH WOW! I cannot believe I missed that, I know better than that. Haha, thanks! I've been trying to figure that out for 3 days now.
    See more | Go to post

    Leave a comment:


  • sdustinh
    replied to DOM exception 8
    BAH! Yes, I am sorry. Each row does have an id of 'nopart'. Sorry, I completely forgot.
    See more | Go to post

    Leave a comment:


  • sdustinh
    replied to DOM exception 8
    Sure, it's pretty simple.

    Code:
    <table id="hdpart-1">
    	<tbody>
    		<tr>
    			<td colspan="9">Remove Me</td>
    		</tr>
    	</tbody>
    </table>
    <table id="hdpart-2">
    	<tbody>
    		<tr>
    			<td colspan="9">Remove Me</td>
    		</tr>
    	</tbody>
    ...
    See more | Go to post

    Leave a comment:


  • sdustinh
    started a topic DOM exception 8

    DOM exception 8

    Alright, I've had this problem for a while, but haven't been able to figure out what's causing it. After searching forever looking through manuals and such, I think I found the answer though I don't know how to solve it.

    First, here is the code:

    [CODE=javascript]var thetable = document.getEle mentById(theHd) ;
    var oldrow = document.getEle mentById('nopar t');
    if (oldrow) {thetable.tBodi es[0].removeChild(ol...
    See more | Go to post
    Last edited by gits; Oct 4 '07, 04:54 PM. Reason: fix code tags

  • sdustinh
    replied to Cycling through table cells
    Got it! Pretty simple, I just make it a lot harder for some reason. Thanks!
    See more | Go to post

    Leave a comment:


  • sdustinh
    started a topic Cycling through table cells

    Cycling through table cells

    Hey, I'm not as familiar with JavaScript as I'd like to be so I need a little bit of help with a problem I've got. I've got a table that I need to cycle through and gather what is on the inside of each cell, and store them into something like an array.

    The table has an undetermined amount of rows (they can be created by the user) but it has 8 cells within each row I need to get the contents out of. I'd like to put it all into an array,...
    See more | Go to post

  • sdustinh
    replied to Matching Element id with RegEx
    Alright, lets see. This may work a bit better...

    I have html set up like this:

    Code:
    <table>
    	<tbody>
    		<tr id="/1234">
    			<td></td>
    		</tr>
    		<tr id="/boot1234">
    			<td></td>
    		</tr>
    		<tr id="/usr1234">
    			<td></td>
    		</tr>
    	</tbody>
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...