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.
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?
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:
I wrote a simple script to remove an element of an array but I don't think this is the best way to go about it. I have a list of about five elements seperated by ";"
I split the array using array.split(";") command and proceeded to update the elemment by assigning the null value to the arrayindex
array[index]=""
This of course assigns null to the element
But there are two problems
1. The array size is still five instead of 4 and my list is now seperated by "," with an exta "," to go.
I've seen several older posts saying there is no way to hide menu bars in IE unless you call window.open().
Is this still the case?
I'm interfacing with a app that I don't have control over. The idea is that users log into my app do whatever and I then populate form tags with user id and password and submit the form to the other app. This logs the user in but the called app is used for reporting and the status bar, menu bar and tool bar take up a lot of vertical space.
I just have one index.html page with NO links NO pics. Just a simple html page.
Whenever I open that page I want to eliminate few things like:
I don't want scroll bar -> I have a solution <body scroll="no"> I don't want status bar -> ? need solution ? I don't want toolbar bar -> ? need solution ? I don't want menu bar -> ? need solution ?
I JUST want the title bar, address bar and the IE window.
I'm trying to remove an html element in the example below. I don't see the "bye" message at the end and there are no errors reported in Firefox or exceptions caught if I wrap the remove child line in a try-catch. Any ideas what is wrong?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>garbage</title> </head> <body>
<div id="my_div">hi<div>
<script type='text/javascript'> var my_div = document.getElementById("my_div"); my_div.parentNode.removeChild(my_div); document.write("bye"); </script>
In FF, this works as I would expect. When clicking on the input, the readOnly property is set to false and the focus is given to the element, with the cursor placed after the last character.
In IE, the readOnly property is set to false, but the element isn't actually given focus. Instead, I have to click on the input a second time in order to actually input text with the keyboard.
Is there a way to make this work the same in IE as it does in FF? I have tried things like calling this.focus() and this.click() after setting readOnly to false, but they have no effect.
In a web based form I am able to make sure that there is text in an input field but I want to restrict the user from using such characters as ~ # & '
How can I modify this JavaScript below to enable this ?
if (document.form1.ProjectTitle.value == ""){ alert("Please complete the Project Title: field") document.form1.ProjectTitle.focus() validFlag = false return validFlag }
When entering the project title into another system it issues an error when those characters are input - hence the need to delete them from the request.
I want to be able to add row at the end of the table with a 'remove' link which will remove specific row. The code I've managed to write so far:
$(document).ready(function() { $("#add_item").click(function () { var html = "<tr id='item_" + item_id + "' class='item'><td><a
[code]....
The problem is it wont instert the row at the proper place (after the last .item (class) and the remove link wont work for the last row in the table/list.
The script I used is from:[url] I can't figure out what the instruction on his page mean.
On the page that I created:[url]
I have finally figured out how to move the description to the left side instead of on top of the image. Now I just need to turn the animation off that moves the description up and out of its box and I can't figure out how or know where to look. Here is the jquery script that I made minor changes to: [url]
I'm working on a webpage where I used this code to display random images. I used it for three images in a row and I keep getting white spacing in between them when they should be right up against each other. This is the code I'm using:
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?
I am using a neat postload script to load a bunch of images into the user's cache after the page has fully loaded, and I have a quick question
<script type="text/javascript"> //<![CDATA[ function postLoad(){ if(!window.name.match(/preLoad.complete/gi)){ var images = new Array('img/EnglishOn.gif', 'img/EnterOn.gif', 'img/EntrerOn.gif', 'img/FrenchOn.gif', 'img/butt_1_blank.gif', 'img/butt_1_red.gif');
var loader = new Array(); for(var i=0; i<images.length; i++){ loader[i] = new Image(); loader[i].src = images[i]; } window.name = 'preLoad.complete' } } //]]> </script>
Can this script be modified to check whether an image has already been loaded, and if so, not reload it? I ask because I may have a long list of images and if the user navigates to another page I would like the script to not re-download X number of images Code: