If Statement Syntax - What The 2nd Block Of Code Means?
Jun 23, 2011
i have the following code:
// This code is defined in one file :
editor.addMenuItem = function( name, definition )
{
if ( groupsOrder[ definition.group ] )
menuItems[ name ] = new CKEDITOR.menuItem( this, name, definition );
};
// This code is defined in another file:
if (editor.addMenuItems) {
editor.addMenuItems({
footnote : {[code]....
what the 2nd block of code means? Does it mean : If the function editor.addMenuItems exists, then call it with the following parameters?? i.e If the function exists then execute the following:
{
editor.addMenuItems({
footnote : {
label : 'Footnote',[code].....
View 1 Replies
ADVERTISEMENT
Feb 15, 2012
I wouldn't even think to ask like that but have a due date till tomorrow. I know its last second but I was detained from health issues.So this is what i have to do with jquery:[IMG]http://uss.feri.uni-mb.si/images/Vaje/Vaja_7_jQuery/vaja1.PNG[/IMG]I totally understand if anyone will *** me out P.S. Naslov opravila means: Title of taskVrsta opravila means Task kindNujnost opravila means Task priorityDatum vnosa means DateOdstrani means Remove
View 3 Replies
View Related
Mar 10, 2010
I've got an annoying non-working bit of code:
<div id ="messageDiv" style="display:block;">No profile information entered yet</div>
<script type="text/javascript">
function profileInfo() {
var m1 = document.getElementById("marital1").innerHTML.toLowerCase();
var b1 = document.getElementById("bodytype1").innerHTML.toLowerCase();
[Code]...
The first part up to before the 'else if' works. but if the 'w1' has [URL] it still doesnt return true and display the DIV block??
View 1 Replies
View Related
May 30, 2010
i get a syntax error message (line 43 character 82) for this line if (document.contest.month.selectedIndex=5 && document.contest.day.selectedIndex=31) { what am i doing wrong here (it is an alert message if the person's birthday is the 31st of may)
View 2 Replies
View Related
May 3, 2011
Code? What is the correct way to write it.
Rules: create an array for the user to type 5 strings in a prompt that will be displayed in an alert box.
User must type in the prompt an alert will display what the user typed if the prompt is empty or contains nothing an alert will display telling the user to enter text user clicks ok on the alert box and is sent back to the prompt box
View 14 Replies
View Related
May 31, 2010
I am trying to check multiple conditions in an IF statement. I did the below, but it is not working right? Whats wrong?
if ((hours == 0) && (days == 0) && (years== 0) && (minutes == 0)) {
//code
} // end if
View 3 Replies
View Related
Dec 4, 2009
I have an ID like this: $('#id').click(function(event){Do stuff after click
}); Can I have it also have a conditional or statement
$('#id').click || $variabe=='something' (function(event){
});
What is the proper syntax for something like that?
View 5 Replies
View Related
Jun 8, 2011
I have an index file that contains absolute barebone html statements and a Flash application. The application is set internally to occupy 100% of the screen. Test site is Flipsauto.info I need to have a content area offset with a DIV statement but can't remember the syntax. In other words, the content area will contain text for search engine spiders to analyze but not be viewable by the user.
View 2 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
Feb 24, 2010
I'm working on a simple slideshow made with jQuery. What I'm trying to do now, is to make it change image every X second. I know how to change image, but i'm kind of stuck trying to find out how to make it "do something" every Xth second.
Here's an example: (obviously not working..)
function slideSwitch() {
//change image...
}
setInterval(slideSwitch, 5000);
//make the function slideSwitch execute every 5th second.
Also, is there any "else if" function in jQuery? Like in for example PHP, you can use "if", "else if" and "else".. like this:
if(){
}else if(){
}else {
}
So is there any function like that? I googled it, and I found out I have to use some kind of plugin for it to work? How do I use it?
View 22 Replies
View Related
Aug 15, 2010
The thing is that I would like to stop pop-over (optin form) from loading on some pages (squeeze page,review pages etc.) and can't find a way to do that. We are talking about wordpress blog here... Is there a some kind of script or code I can use? Should be, it's not a rocket science. Just want to kill the process on some pages...I'm using popup domination [URL].
View 4 Replies
View Related
Feb 5, 2011
I need to somehow hide this block of HTML code in my page. Now I have no control over the code as it comes from another site so there is no ID or anything. If the <a> or <td> tags had ID I could hide it with javascript.
Code:
<tr>
<td>
<center style="color: rgb(82, 87, 87); font-size: 10px;">Some Text <a target="_blank" style="color: rgb(82, 87, 87); font-size: 10px;" href="http://google.com/">google is good</a>
</center>
</td>
</tr>
View 6 Replies
View Related
Jun 10, 2009
I'm having a problem with copying text into the # code window. When I select the code that I want to copy, after opening the code window, I can only paste the code line by line instead of pasting the entire block of code. I can copy the entire block into word/notepad. Is there a technical issue preventing this from working?
View 1 Replies
View Related
Aug 8, 2011
Trying to adapt my working email code to work on a different page... I have VERY little javascript experience...and don't know proper syntax. I want to put this on a page that is created with a while loop (php) and has many members on one page. So it needs a unique identifier for the form (and I think each field in the form) so it will properly update back to the correct section of the while loop (instead of just the top one like it does now.).
Javascript
var thisRandNum = "<?php echo $thisRandNum; ?>";
// Start Private Messaging stuff
$('#pmForm').submit(function(){$('input[type=submit]', this).attr('disabled', 'disabled');});
function sendPM ( ) {
var pmSubject = $("#pmSubject");
[Code]...
View 3 Replies
View Related
Nov 27, 2011
I am thinking of how to write the code for below scenario to create a simple online customize calculator:There is 1 box which allow us to enter any number=x (representing amount of money). So whenever we entered a number in the box and click "CALCULATE" buton below the box,there will be 3 results generated in 3 boxes below it based on the set of of rules i.e.
1. if the amount entered is <21,000
Result 1 = 1.5%*x*12
Result 2 = 1.5%*x*48
Result 3 = 1.5%*x*120
2. if the amount entered is >=21,000 and <210,000
Result 1 = 1.8%*x*12
Result 2 = 1.8%*x*48
Result 3 = 1.8%*x*120
3. if the amount entered is >=210,000
Result 1 = 2.2%*x*12
Result 2 = 2.2%*x*48
Result 3 = 2.2%*x*120
I understand that this code will involve If...else if...else Statement..
View 7 Replies
View Related
Mar 25, 2011
I am having the following problem with the " Next " link not working in Firefox, Chrome, Opera.
Code:
<td>
<%If Cint(iMore) > 0 then
if iMore > iRecsPerPage then iMore = iRecsPerPage[code]....
The funniest thing is that the " Next " link works in Internet Explorer only.
View 6 Replies
View Related
Jan 31, 2011
I am new to JQuery. I am using Block UI in my application.In submit button onclick event, i am performing client side validations ( required fied validators )in asp.net.On clicking submit button,whole page is blocked and at the same time validation message is also displayed and page remains blocked. While performing client side validations i don't want to block the page.
View 3 Replies
View Related
Jun 7, 2011
With this code, it is not closing properly and I can not get it to work;.
"Its a radio button selection named "status" it has two values 0 and 1
<script type="text/javascript">
View 3 Replies
View Related
Jun 2, 2009
I got this code from elsewhere online, but i dont understand what this line mean,
var nextslide = currentslide.next().length ? currentslide.next() : $('#supersize :first');
what does it mean with a '?' and ':' in the line above?
Below is the full code,
function theslideshow() {
var currentslide = $('#supersize .activeslide');
if ( currentslide.length == 0 ) currentslide = $('#supersize :last');
[Code]....
View 2 Replies
View Related
May 27, 2009
I am building a website that offers cash to users for completing offers. Such as signing up on a site and you get $1. I have very little javascript knowledge. But I do know that it can be used to "listen" for mouse clicks and such. So I am wondering how to go about it. Can I somehow, listen for mouseclicks a user makes, tracking what they clicked on, when they clicked on it, etc. inside a iframe, then pass the values thru php into my DB? I have also just started learning about cookies too, The other 'offer' sites I am a member of, and I would like to duplicate, (ex. www.inboxdollars.com) say sit uses cookies to track user actions for verifications.
View 1 Replies
View Related
Dec 8, 2010
I am going to validating a checkbox which is created dynamically that means the field name is not fixed everytime .Here is my html code
HTML Code:
<tr>
<td class="Cat" bgcolor="#cccccc" style="padding-left:10px; border-bottom:1px solid #ffffff;">Computer<span style="color:#fff;">*</span>
</td>
<td style="padding-left:10px;">
laptop<input type="checkbox" name="n5_Computer[]" id="n5_Computer[]" value="laptop" />
[Code]....
View 1 Replies
View Related
Apr 4, 2011
my webstie allows users to change the color of the background, so to keep the text readable I have it changing as well.the color picker I am using has text boxes with rgb values 0-255 for each.I am trying to get one bit of text to alternate between red and blue with the conditions
Code:
if(blue>green && blue>red)
{
[code]....
View 2 Replies
View Related
Jun 6, 2010
i'm a newbie on jquery i'm studying it with the latest version, and following a book called "Learning Jquery" but iencountered a error, and i don't know what the problem is:
i copied the code from the book like this:$('a[@href^="mailto:"]').addClass('mailto'); to try to change the links which start with "mailto" to the new class "mailto" but there's a error reported: uncaught exception: Syntax error, unrecognized expression: [@href^="mailto:"]
View 5 Replies
View Related
Jul 23, 2005
I need to block a URL from printing at the bottom of the page from a
website. Is there any code that can do that? I know I can make it
into a PDF on the fly and that will elminate alot of hassle, but is
there any easier way?
View 5 Replies
View Related
Jul 23, 2005
Is there a more concise way to do something like the the
desired code below?
The gripe is with the try-catch syntax. It takes *way* too
many lines of code to evaluate a conditional expression
when zero or more parts of the conditional expression may
trigger an error. In this case, the trigger is a call to
a non-defined (null) object.
In other words, how can you do a more simple 'try' statement
that simply spits out true or false, depending on whether
the 'tried' code threw an error or not?
Defining a function don't seem to work because you
can't pass the 'try' code as an argument. Extending the
'Global' constructor is not an option, so now what? Code:
View 3 Replies
View Related
Dec 13, 2011
I'm trying to keep visitors from using % to do a full sheach on a database in calssic asp using javascript
View 1 Replies
View Related