I got an [object error] from IE 7.0.5730.11 when moving the <script src="..." type="text/javascript" /tag from the <headpart to the <bodysection of a HTML file.
Is not possibile to include Javascript code via <script src="..." type="text/javascript" /from the <bodysection, instead from the <headone? If yes, anyone has any idea of which the problem could be? If not, how can I programmatically include a javascript external file inside the <bodypart of a HTML file, for example, using Javascript to some particular native functions?
I am using a Jquery/PHP/MySQL login script which is supposed to display an error or success message when the user enters their username/password and also if the username/pw is successfull go to a secure page. Right now as I have it coded, this isn't working properly. Basically nothing is displayed either way.Also,wasn't sure if I just needed to replace, the ?secure-page part with the file name of the page I want to go to if successful?Here is the code as I have it now.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html>[code].....
I am trying to make a generic function called whenever the window size changes. I want this function to apply to several different images. The idea is that when the window is resized the function will only change the end of the source code by replacing "_small", "_medium", "_large" with the appropriate size depending on the window. The problem is that when I use the code below it makes ALL of the images the same. The variable imageRightIdStr genereates a list of ids of all of the images that I would like this function to affect. ex: #imageRight101,#imageRight201,#imageRight202,#imageRight203,#imageRight301 etc.
Here is the code that I have now. It mostly works except it makes all of my "imageRight_" images the same. var contentwidth = $('#background').width(); if ((contentwidth) < '1175') { var logo= $('#pageLogo'); var rightImage = $('.rightImage'); logo.attr('src',logo.attr('src').replace('_large','_small')); logo.attr('src',logo.attr('src').replace('_medium','_small')); $(imageRightIdStr).attr('src',$(imageRightIdStr).attr('src').replace('_large','_small')); $(imageRightIdStr).attr('src',$(imageRightIdStr).attr('src').replace('_medium','_small')); }else if ((contentwidth) < '1440' && (contentwidth) > '1175') { var logo= $('#pageLogo'); var rightImage = $('.rightImage'); logo.attr('src',logo.attr('src').replace('_large','_medium')); logo.attr('src',logo.attr('src').replace('_small','_medium')); $(imageRightIdStr).attr('src',$(imageRightIdStr).attr('src').replace('_large','_medium')); $(imageRightIdStr).attr('src',$(imageRightIdStr).attr('src').replace('_small','_medium')); }
I tried finding a similar situation in the forums, but was unable to discover anything sepcific. I think I may be way off here, and or trying to do something bizarre, but what I am trying to do is change only part of the the url for all of the links on a page. So say I want to change:
href="/something/something/all"
to
href="/something/something/specific"
I think I need to use each() in combination with attr but I am not exactly sure how. This is what I have so far (with no luck):
I've successfully changed part of a single link based of it's enclosing div id, but if there is more than one link in the div, it replaces the entire href of all the other links in that div to be the same as the first one. So that's why I think I need to use each(). But again, I'm not sure how to do this properly in this case.
I have an HTML page that displays content, but I'd like to transfer them to a JS file when they click a button. In other words I'd like the equivalent of doing this:
Code: <a href="myscript.js">Click here for Help</a>
Obviously this doesn't work.I tried the following, which attempts to transfer, but the screen just goes dark:
this will match any instance of a number following a letter/[a-z][0-9]/gmiso thatvar str="abc123 456";alert(str.replace(/[a-z][0-9]/gmi,''));would return "ab23 456".
how would i replace just the number? so as to get back "abc23 456" - or ideally "abc 456" ?
I have a JS which I have already started to try to customise, but I am having some difficulty with it in that when I click on an image, it does not take me to my html page.with care.html. Although all files are in the same folder, I get an error indicating that the fille cannot be found (I have checked the file name spelling). I am not doing any of this online as the Web pages, when working, will be put on CDs.
Can anyone explain why replace doesn't work in the code below, the anchor text doesn't change when I click on the link.I will be happy if someone can tell me
1. how to change the linktext to "Hide information" when I click on the link. 2. how to hide the showInfoText (which has been visible when I clicked the first time) when I click on the link - now with the text "Hide information" - again. 3. how to make the link clickable again. Just now it is only clickable once.
i want to add a part of the website that will be generated from mysql database from an external file just like php include just that i want these parts to update realtime without refreshing the browser. i also want it to have pagination.
I currently have a link that links to a different part of the same page using <a href="#title"> which is defined using <a name="#title">. It all works fine but when clicked it adds #title to the end of the URL and when the user clicks the back button it goes back to when they clicked the link rather than actually going back a page which is very inconvenient for my site.
I have seen that on Facebook this has been done so I know there is a way, I just don't know how or what exactly to search on Google.
I have no idea about javascript but wanted to use the Konami script on my site. This is the current code:
var kkeys = [], konami = "38,38"; $(document).keydown(function(e) { kkeys.push( e.keyCode ); if ( kkeys.toString().indexOf( konami ) >= 0 ){
[Code]....
I just wondered how to get the javascript to include the class so that it acts in the same way it would if just clicking the link. I imagine this is upsettingly easy to do but I can't seem to find anything about it!?
Does anyone know if I can save part of a web page to a file on the users computer without saving the whole web page? I know I can print part of a web page using style sheets, will this work for saving also?
If not possible, can I use Javascript to program a button the end user can click to save data to a file on their computer?
I'm trying to write a widget for Mac OSX Tiger. Here's the problem: The user enters a search term which is sent to a perl script on a remote server. This script returns a fully formatted HTML page. I only want part of that page to be displayed. How do I go about doing this?
I'm creating a page where I have multiple articles on one page. I want to display only part of each article and display a "more..." link at the bottom of each of the articles. If the user clicks on one, the rest of the article shows. What would be a good approach to do that?
I want to replace all text in the html that contains the word "Hello" to "Hi" (quotes not included and not case-sensitive). Here's what I've made: if ($('body:contains("Hello")').length > 0) { $("*").each(function () { $('body').html($('body').html().replace('Hello','Hi')); });}
Without the: $("*").each(function () { It only searches for the first word so I added the line above to search within all elements (If this is correct). But the problem is, I notice that the line I added seems to cause the page to run slower than usual. Is there any other way to do this?
I'm trying to put in my javascript codes and html codes into the sharepoint "content editor web part" source editor.i have this set of javascript codes that needs to work together with the html codes.i created a link using ahref with the tagname as "homepage". i want to hide this "homepage" link using javascript codes.this is the codes that I'm using right now. the html part is working fine[the link "Homepage" is being display and is able to click on] but not for the javascript part.
I'm trying to come up with what is probably a kludge. What I'd like to do is take the responseText from an AJAX request -- which will be a full HTML page -- and parse it first to find if there is a <form>...</form> in it. If not I'll display a success message and all is fine, but if it's there, then I want to extract just that form section and display it within a <div> in the page.
This is where my JS skills are failing me. Can anyone point me to the applicable functions, tutorial, or whatever that would show me how to find the <form> and extract it and then replace my div contents with it (just innerHTML?).
I'm loving this: Sliding Login Panel with jQuery 1.3.2 However, I'd like it to work so the 'Close Panel' link actually appears in the #panel itself and doesn't swap/toggle with the 'Login | Register' part.
I wanna send a file thru the JQuery.load, I want it to work exactly like the regular post without the JQuery. So I can check the $_FILES['file']['error'] in PHP and all its features like I do without using JQuery.
$("#load").load('gerenciar_itens.php',{/* This is where I wanna pass the file. */}, function(data){ alert(data); });
Can method replaceWith() be used to replace just ONE WORD in body of a tag (i.e., element.html()?) with another word? I have li's with "tab one", "tab two", "tab three" etc.. I have to replace dynamically ONLY the word "tab" with another word..