Minimalization And Configuration - Remove Some Lines Of Code ?
Feb 23, 2009
What I want to do is remove some lines of code, because more lines are bad and I hate them. I'm all about minimal lines in a project. I'm also all about making quality projects that can be easily changed, edited, updated, etc.
So what I need is a way to minimalize the following block of code, and make it available in a seperate javascript source file (*.js)
Code:
View 1 Replies
ADVERTISEMENT
Jan 29, 2011
This would prevent new line on textarea when pressing enter key:
$('#text_description').keypress(function(e) {
if(e.keyCode == 13) { e.preventDefault() }
});
but how to remove lines when pasting into text area?
View 1 Replies
View Related
Jun 21, 2009
i need to remove all lines containing text from each line in downloaded.txt from the file download.txt.So I have a function Remcon.I need Remstr = to every line of downloaded.txt , and text ill fix my self.
function remcon()
{
var text = document.form_rli.input_output.value;
[code]....
View 1 Replies
View Related
Jul 20, 2005
for(var i=0;i<document.all.elements.length;i++){
alert(document.forms[0].elements[i].id);
}
This code displays the ids of only controls in a form, but I'd like it to
display ALL items. For example, not just the ids of buttons, inputs, etc,
but any <span> elements as well. Is there something I could replace with
the "elements"? I tried tags but that doesn't work either.
View 3 Replies
View Related
Apr 27, 2010
I am using JQuery 1.42 to write a simple popup table to show some information to users when they move the mouse over a string of sentence.Here is the code I copied from a web site:
<script>
$(document).ready(function(){
$("#link").mouseover(function(){
$("#popup_menu").show();
[code]....
But I don't know how to do this in JQuery.
View 1 Replies
View Related
Oct 19, 2009
I need to pass two lines of code through an onClick event.player1.sendEvent('STOP');player2.sendEvent('STOP');
I tried <a href="javascript:void(0)" onClick="player1.sendEvent('STOP'); player2.SendEvent('STOP');" title="<?php echo $list[$i]->title ?>">
only the event of player1.sendEvent('STOP'); is working... but not the second one. How do I manage this right here on the link rather than calling a fuction.
View 4 Replies
View Related
Apr 23, 2010
PHP Code:
if (navigator.userAgent.toLowerCase().indexOf('msie 6')!=-1){
$("#pdfPopup img[@src$=png]").pngfix();
$("#pdfPopup .sidebar ul").css({
background: "none",
filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+urlRoot+"/images/BKGmodelsBox_grad.png', sizingMethod='scale')"
[Code]...
This is a part of the larger .js code. It fixes .PNG images problem specific to IE6. Everything works fine in Firefox, Opera, IE6 and Chrome. The problem appears only in IE7 and IE8. JavaScript stops executing somewhere after the second line, and the browser reports an error in .js file on that line.
View 9 Replies
View Related
Jun 13, 2009
i've been using JQuery up until now but because a site I'm working is coded in Moo Tools, does anyone know how to translate these lines of JQuery into MooTools -
Code:
View 5 Replies
View Related
Dec 17, 2007
I am a novice, almost to an intermediate-level JavaScript guy, so much of this is new to me. I appreciate your patience reading this.
I have a routine that creates some HTML on the fly (updateFilters() function) and after the HTML is created, I attempt to access some fields (elements) on the form itself.
I works fine if I place an alert() statement after the HTML is created, but when I remove, the code errors out.
I have tried the setTimeout() statement, but I cannot grab the element --- undefined or null is returned. It seems that the form is the only element I can get a handle on --- everything else is undefined or null...
Here is the code:
function editQuery() {
var f;
var x;
var myForm = document.forms[0];
// Get the row filters that were used in the last query..
for (f = 1; f < 16; f++) {
var filter = eval("myForm.FilterList_" + f);
if (filter.selectedIndex > 0) {
var methodElement = element("FilterMethod_" + f);
var methodIndex = methodElement.selectedIndex;
var savedFilterMethodValue = methodElement.options[methodIndex].text;
var choicesElement = element("FilterChoices_" + f);
var choicesIndex = choicesElement.selectedIndex;
if (isNaN(choicesIndex)) {
var savedFitlerValues = choicesElement.value;
}
else {
var savedFitlerValues = choicesElement.options[choicesIndex].text;
}
updateFilters(filter); // update the filters
// take the saved methods and values and then update the selections
// Alert here makes the code work..
// alert("Try this");
// Wait for HTML..
setTimeout("completeEdit()", 1000);
function completeEdit() {
// Since the object was updated, get the object again..
var methodElement = element("FilterMethod_" + f);
for (x = 0; x < methodElement.options.length; x++) {
if (methodElement.options[x].text == savedFilterMethodValue) {
methodElement.options[x].selected = true;
break;
}
else {
methodElement.options[x].selected = false;
}
}
// Since the object was updated, get the object again..
var choicesElement = element("FilterChoices_" + f);
for (x = 0; x < choicesElement.options.length; x++) {
if (choicesElement.options[x].text == savedFitlerValues) {
choicesElement.options[x].selected = true;
break;
}
else {
choicesElement.options[x].selected = false;
}
}
// Only display next row if f = 2..
// If only one row was used, no reason display the next row..
if (f == 2) {
displayNextFilter(f - 1); // display it
}
}
clearTimeout(timeOut);
}
}
}
Do I have to pass the object (the form, the elements) to the completeEdit() function in the setTimeout() statement?
View 5 Replies
View Related
Jul 31, 2011
I couldn't do a xmlhttp.open("GET" [url] true)
The problem was something along the lines of the script not being allowed to call a page from another domain or something..
View 1 Replies
View Related
Feb 14, 2007
Is there a way web.config could be accessed from client side scripting like javascript
View 1 Replies
View Related
Dec 14, 2010
The problem is that I'm making a script and I need to have the information of a website on the script which is in a different document. The code of the website is similar to this:
<html>
<head>
<script type="text/javascript">
var name = prompt("Put here your name");
var surname = prompt("Put here your surname");
[Code]...
But I want to give the value of the name and surname to the vars of another script: var name = "What I have to put here to get the info of the web?"; var surname = "What I have to put here to get the info of the web?";
[Code]...
View 3 Replies
View Related
Mar 21, 2011
Why doesn't this code work?
Code:
Code:
It is supposed be just 2 different lines of changing buttons. I was planning to use the "+" and "-" buttons to add/subtract button lights from a column. Unless I did something wrong, I think it should work, but it doesn't... Why?
View 2 Replies
View Related
Jan 13, 2010
I need to read configuration information into my script, possibly an xml file or a text file. Is there an existing library or script that can do this?
View 2 Replies
View Related
Jun 13, 2010
what's the way to avoid configuration object is undefined?
[Code]...
View 1 Replies
View Related
Oct 10, 2011
I have the following line of code in a page and I need to 'hide' the entire row [code]...
Is there a way to do that?
View 1 Replies
View Related
Oct 9, 2006
I wrote a JavaScript that removes the white space from javascript source code in order to speed up download times.
For instance:
View 3 Replies
View Related
Jan 7, 2006
It's been too long since I've used javascript! What do I need to add to this code in order to remove the scrollbar (or scrolling option) and the browsers' address & tool bars?
Code:
<script language=javascript>
<!--hide from old browsers
window.resizeTo(600,500);
window.opener = self;
//-->
</script>
The above code is in the <head> of the page that is being resized and stripped of scroll/address/tool bars. And will it only work in IE?
View 14 Replies
View Related
Sep 16, 2011
I had to maintain older javascript code with some jQuery addons / plugins (I guess also old ones).
Today I found this:
I looked into the api documentation I found some days ago also ".height()"
As I understood that code like this: "jQuery.fn.height" will overwrite the current "height" methode in jQuery.
Is this right? And why the code in line 1 (see above).
I want to remove old javascript code, and also the code above. I found similar code snippets where all the jQuery function on this page [url] will be overridden. And also for "scrollLeft", "scrollTop", "offset".
The incode documentation in the old js-code says also something about "Plugins/Dimensions".
Can I remove the code, because it is old code for a jQuery version where the "height" is not implemented?
View 1 Replies
View Related
Dec 12, 2011
This time I have a trouble with remove(). Here is my code :
$.each(val.produitsIds,
function (j, val2) {
if($('#chk_' + i).prop("checked")){
//$('#' + val2).prepend("<div>liste des tailles</div>");
$('#' + val2).prepend("<div>" + $('#chk_' + i).attr("value") + "</div>");
}
[Code]...
View 2 Replies
View Related
May 12, 2009
I want to remove a specific box when i click on the remove button in that box. I have a lot of boxes on a page but when i click on the remove btn it removes all the boxes. I just want to remove the box where i click on the delete btn.
This is the js code:
$(".del").click(function() {
$('div.floating-box').remove();
});
[Code].....
View 3 Replies
View Related
May 26, 2011
I am in position to get the no. of lines in a 'div' and the words in each line inside a div tag. Is this possible to achieve using jquery. I have googled for so many hours but could not find any results related to my requirement.
View 3 Replies
View Related
Jul 4, 2010
I want to jQuery to format the following [code]...Wrap new lines with <p> tag
I have read a zillion posts and some that are similar but have not been able to translate them into my problem.
View 6 Replies
View Related
Jun 26, 2009
How can the output of the following code be written on separate lines ?
View 3 Replies
View Related
Jul 31, 2002
An interesting way of drawing a line interactively without the need for any plug-ins....
View 6 Replies
View Related
Mar 31, 2006
I'm trying to make a small in page editor and was wondering if there is anyway to add line numbers to my textarea. Does anyone have a solution?
View 1 Replies
View Related