The problem I have is if the value of the recordset contains a CR, the function errs. How can I replace the CR with a /n or something similar that fixes this problem?
questions raw = [ ["<Q1> Question", "choice1","choice2", "choice3"], ["<Q2> Question",
[Code]....
And I want to list all of the questions, but not the choices/answers. So far, I've managed to list just the questions, but because another function randomly sorts them, I need to sort them back into numerical order for a separate function (displaying the questions)
I use characters (>,^) at the front to separate them into different answer types (just to explain the code)
I try this to cut each string down so that they can be sorted numerically/alphebetically -
function linearlist() { var list = []; var tempStr = "";
[Code]....
But it doesn't like it - because "it has no method charAt"
Is it just that you have to put the [l] in every time you call a variable?
The last line in this JS function should remove the final comma from the end of the given string... but for some reason, it does not.Instead of returning something like:
I need a simple, quick and efficient way to logically branch if I find a string is contained in another string in jquery Most other languages this can be resolved in one or two lines and it would be readable.
I have a simple example below showing how when I pass in the value of the value attribute of option node, and then use if operator to check whether parameter is a string or not, even though it's a string, it converts it to false boolean and triggers the else statement rather than calling a function.callback should be a string so why is it saying otherwise?
I have made a basic form, and I need to combine three values within my form, then create an md5 hash of this string.Then assign it to a hidden variable.My form is here...
Or I have created a pastebin of it here, for easy reading: http://pastie.org/1171757.So I need to be able to combine the three values into a string, create a md5 of the string, then call the value of the string into a hidden value all before posting the form.
I need help with substring or trim function in javascript. Find below my code. Selection holds the value Select State, and length of the string is 14. I need to equate the Selection value to string "Select State" and execute alert message.
function selected_item() { if (Selection=="Select State") alert("Select the State");[code]....
I tried this:
var state=Selection.substring(0,11); and then string would be equated to state variable. But it is not working.
I have an HTML file that has a call to a Javascript function in it as follows:
<!-- bunch of stuff --> <script type="text/javascript">doXMLFromString()</script> <!-- bunch of stuff -->
Now I make a copy of this HTML file by creating a new window and writing
var body = document.body.innerHTML; printWin.document.write (body);
But this copies the script tag above as well, and then tries to call that JS function (doXMLFromString). I don't want it to do that.
In other words I dont want that javascript statement to be executed. I tried removing it from the document (using removechild) however it would still get called.
And remove the &sort=XXX without hurting the rest of the url. The parameter to be replaced would be a parameter passed to a function. Here is what I have so far:
function refresh(item) { current = document.location.href; if(current.match(item.name+'=')) //pseudo code here //current.replace(item.name regexp , '');
I've been given a large number of HTML pages. Each page has one or more tags. When the pages were being built I asked that an ID attribute be included with each element that will later be referenced. The first ID'ed element on the page has the ID 'item0', the next 'item1' and so on.
Unfortunately they also included a NAME element which in many cases is similar to the ID but out by one. That is the first element on the page has the NAME 'item1', the next 'item2' and so on.
This stuffs up some things that depend on the ID (IE seems to make use of the NAME instead of the ID when I ask getElementByID). Is there an "easy" way to remove all the NAME attributes, or at least make them invisible to IE, on page load?
I'm having an issue in Internet Explorer to where the javascript i'm using isn't working now. In firefox it works great!
Code:
<script src="::URL::/jscript/php.js" type="text/javascript"></script> <script language="Javascript"> function gup( name ) { name = name.replace(/[[]/,"\[").replace(/[]]/,"\]");
My goal with a script I am writing is to remove signatures from a forum I am a part of. Some of the people abuse it with half a page of stuff and it's out of control. So here is what the HTML source code for it looks like
The very bottom where it has the 'span' tag and it says "SEC Champions" is where the Signatures are located. I want to completely remove that using my script and this is what I have right now
function sigRemove() { var sigs = document.getElementsByTagName('span'); for (var i = 0; i < sigs.length; i++) { sigs[i].style.display = 'none';}}
I know it's incomplete but I only want to remove that bottom span tag and everything inside of it and not every span tag on the page.
I have finally figured out how to make a call to an XML file using AJAX and then bringing it into the browser to manipulate with JavaScript. The only problem I'm having now is that I can't figure out how to remove the whitespaces between nodes so they won't show up as a childNode.
I'm working on a Wordpress site and am using a photo gallery plugin. However, this plugin, for some reason, generates an empty table row and it's messing with my layout because I'm inserting a background image for each of the "TDs". I don't want to mess w/ the core files since the changes will be gone after the next upgrade. check out these two image links to see exactly what I mean.
[URL]
I know there are ways to dynamically remove elements using DOM. Would I be able to use that method here?
-edit- This gallery is paginated and I just noticed that on the last page, the last row actually contains two pictures and a " ". So, a better question would be: Is there a way to target just the td elements that have in them so I can add a display:none via css?
There doesn't seem to be any mechanism to "clear" a node of all it's children (not that its necessary very often, but I have come across situations where I'd like to clear a node of all it's children before appending other nodes). I've come up with two possibilities: Code: