Preventing The Target="new" Attribute From Working?
Oct 9, 2009
I'm using the built-in Dreamweaver code to do a simple jump menu which displays a .pdf file when the user selects one from a list. Here's the entire script code, all 3 lines of it:
Code:
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
}
Here's a snippet from the select list, with the call to the script:
Code:
<select name="anFlyers" id="anFlyers" onchange="MM_jumpMenu('parent',this,0)">
<option selected>Choose a Flyer</option>
I have a homepage with two frames. The left frame is the navigation menu with about 30 links to different websites. The right frame (frame name is "display") is used to display the content of websites when user click on the links on the navigation menu.Left Navigation MenuThis is part of the codes of the Left Navigation Menu:
I have the .box class applied to a div basically I what to hover over the div change the background color of the div and at the same time change the text color of any text wrapped in p tags. I am getting close but with this code every instance of the p tag gets swapped out I need to know how to target only p tags in the div that I am mouseing over
I'm trying to parse my anchor tags, by getting all the href attribute available in the page, and then i will loop through this attribute values and then parse it. if each href value is equal to "mypage.com", the link will open to the same window, but if not it will open to a new window, more like the concept of determining internal and external links in a page.
Im trying to make a script which when I click on the list element... it will replace a big image with anotehr picture. The list element is a thumbnail... and I want to swop the big image with the big version of the thumbnail. Each <li> has a rel attribute... but while I can pull out each <li> from the list, for some reason the following code, yields an 'undefined' value... instead of the big-image-path...?
Attr('id') not working in AJAX. I use jQuery UI. I check and attr('class') not working too. Code: $.post('ajax.php', { top: $(".ui-draggable-dragging").css("top"), left: $(".ui-draggable-dragging").css("left"), width: $(".ui-draggable-dragging").width(), lenght: $(".ui-draggable-dragging").height() }, function(data){ goStart($(".ui-draggable-dragging").attr("id")); if(data == 'no'){ alert("1 :(");} else if(data == "yes"){ alert("0! :)");}});
I am working on an Image Map project, the project must be written under xhtml 1.1 and must validate. The problem is Firefox and Safari will not support the image map without the name attribute, internet explorer does. If I add a name attribute to the image map, the code will not validate under xhtml 1.1. Is there any way to have this work without the name attribute in FF and Safari? The inline styles will be remove later and I would also like to replace the variables with an array but for now the focus is on getting this to work in FF without the name attribute. I can just change the doctype to transitional but we have to use xhtml1.1.
Here is the code: Code: <script type="text/javascript"> var koalaMouth = "This is my left ear!"; var koalaLeftEye = "This is my left eye!"; var koalaNose = "That is my nose!"; var koalaMouth = "That is my mouth!"; var koalaRightEye = "And that is my right eye!"; function writetext(message){ document.getElementById('displayText').innerHTML=''+message+''; }function defaultText(){ .....
Here's what I hope to be a quick question that I should be able to figure out myself... but, unfortunately, I can't...I'm trying to pass a variable into the attribute selector. When I substitute the "+myHref+" for "http", I get a match. When I log the myHref var, I get a match. What's wrong with my syntax? Why isn't the myLink finding a match?
I am trying to get my script working in FF, IE and Opera but the getAttribute isn't working for me. The domain name isn't getting picked up I have tried this:
i want to submit form data from the popup window, close the popup, and load in the main window. problem is, it always opens a new 'tab'. i'm using google chrome, i didn't think to try this in
in the <head> of the 'main' window: <script language='javascript' type='text/javascript'> window.name='main'; </script>
However my problem occurs when the user uses the browsers back arrow to return to the previous page, the script executes again returning them once more to the page they have come from. Is anyone aware of a work around to this problem as it would seem there isn't one? perhaps even a better solution for opening the target page from the iframe as top location. This is really causing confusion for users, and I really need to get the issue fixed.
i have found a possible bug in 1.4 but it's only in Internet Explorer 7 & 8.The following code does not work and completely ruins every peice of jquery on the page (that means everything inside $(document).ready and anyting else...
I cant see any syntax errors - i pulled the example from the 1.4 site. There is no trailing commas in the object notation and i really cant see any reason it would work in firefox and not IEx and more to the point not only not work in IEx but break any other jquery in the entire page....
I'm working with a large (and unweildy) ASP.NET application, and there is a lot of jQuery code that uses selectors like this:
[name=_aspnetControl$_withASubControl] And unfortunately, some selectors that also look like this:
[name^=_someAspNetControl$_radioButtonList].
In other words, the effort to remove the $ from the attribute selectors would be monumental. If it is possible to escape the $ symbols, I can do that easily enough, but unfortunately the situation right now means that I can't upgrade to jQuery 1.5.
I'm learning jQuery with XML. I'm familiar with other query languages such as XPath. I'm having a little bit of difficulty wrapping my brain around how jQuery works but I think I can make the leap if I see a solution to a problem I know how to solve with other methods Given the following XML, please share a jQuery solution to finding the value of attribute B in elements named bar where attribute A has the value 30:
I don't know why but it's not working no matter how much i try to do it. I was planning on posting some elements on a page's div and one of them allows for mutiple things going on at once, as in allows for someone to have more than one of something. And since i don't think that it'll be working right if i try to pull it from 1+ items with the same name it'd just show the last one? Or is it that PHP would show them as a list... either way it's seeming that .attr() doesn't allow for a name change for some odd reason. And i was wondering if there was any function to allow for this to be changed easily written within jquery.
I'll trying to tell the difference between the following three cases:
<img alt="text string" /> <img alt="" /> <img />
I can do this in Firefox with the following code, where elem is the HTMLElement representing each image, but IE doesn't seem to differentiate between empty string and undefined.
var alt = elem.getAttribute('alt'); alt = (alt) ? alt : ((alt===null) ? 'really_null' : "");
The desired output from running this code on the 3 tags above is:
text string
really_null
It seems like this should be really easy...but I'm having a really difficult time trying to figure out what's going on...
I have a Java GUI application where I perform a lot of long DB operations [e.g. massive SQL Insert's], which takes 5-60 secs to perform. Sometimes user double-clicks the button or just gets impatient and clicks again, which created duplicate records.
So I am trying to disable the button as soon as it is clicked, and as soon as it's done, re-enable it again.
I tried to do it in Javascript, just simple: <input... name=Save... onclick="enabled=true;"> and as soon as screen refreshes, it re-enables the button automatically.
That works in some cases, however when I need to do some other Javascript operation (e.g. validate() the fields on the screen), disabling the button automatically stops both Javascript and association form action in Java which is totally unacceptable.
Is there any other simple solution to such problems in Java or Javascript?
Instead of searching and replacing unwanted character in strings using cgi/perl, I would like to prevent some characters from ever being typed in text boxes and textfields. Two characters I would like to stop are "|" (pipe symbol) and the "carriage return". I am not even sure how to search and/or replace a carriage return in a string anyway. This may be a JavaScript function, because what I would really like to do is send an alert to tell the user that it is not allowed.
I have an <input> box and i want to disable the apostrophe ( ' ) key, so when you press it, no character appears in the input box. All other keys should work ok.
I can trap the keypress event using "onkeypress=myKeypressHandler()" but, beyond that, I'm stuck. I forget how to detect what key was pressed or how to "null it out".
I'm using IE6 and users will be IE5.0 upward ONLY (trust me on this, suffice to say it's not a website but an intranet application).
I need to html encode all text field values on the client just before sending them to the server. A javascript equilalent of Server.HTMLEncode in IIS. I also need to be able to perform the reverse.
All I am trying to do is ensure that if a user enters html tags in the a form, that the tags does not get parsed by the browser.
I have a colour picker on my site, see it at [URL]Now I want to change the colour of the links on the page, don't worry I know how to do all this.
It's just if someone chooses full black (#000000) the theme looks awesome, but the links on the dark background are invisible.
Similarly if someone chooses full white (#ffffff) then you can't see the text on the white background.
So I want to know if you geniuses can make it so when a variable containing a hex, like #000000 is set as the main colour, then the link colour is changed to #666666 so you can still see it, but I want it to work with colours, so if you had #360000 (dark red) then the link colour would be something like #a10000.
I hope I have explained it well enough for you to understand, here is my code to change the background: