Get Syntax Highlighter Working?
Oct 4, 2011
I came across a nice looking Syntax highlighter that I wanted to implement on my web page. It's called SyntaxHighlighter by Alex Gorbatchev. I thought I followed the installation steps in the home page manual all right, but apparently i am missing something. All of the necessary .js and .css are included in the proper manner in my code. (Firebug never complained.)
[Code]...
View 2 Replies
ADVERTISEMENT
Jul 20, 2005
How can I use a TextRange object to search for text, and then
highlight it?
The enclosed example works, until you dismiss the alert (done just to
show the results). I would rather the text stayed selected! I guess it
is because the TextRange object r goes out of scope? or summat? Code:
View 2 Replies
View Related
Jan 23, 2011
I'm curious if this is something simple. I'm working on a wordpress site using a plugin that is based off of the code from javascript kit called "highlighter scroller script". The plugin js is almost identical:[URL]..
What is causing it to wipe from left to right? I'm racking my brains trying to figure it out (and googling unsuccessfully it seems). All I'm trying to do is make it wipe instead from right to left. I'm sure it's something simple, but I don't know which variable to change.
View 1 Replies
View Related
Jan 19, 2011
I know I have a simple syntax error. Trying to call a function which changes the style of a div element on mouseover. Heres my code.
Javascript
function countermarker1(){
var box1 = document.getElementById('countermarker1box').style.display
box1 = "block" }
Variable is used cause I will have to use it more often later in the script.
HTML
<div id="countermarker1">
<img src="countermarker.jpg" width="20" height="14"
onmouseover = "countermarker1()"; /></div>
CSS (know its not really relevant just to avoid questions about whether its right)
#countermarker1box {
height: auto;
width: 80px;
display: none;
}
JS and css is externally srced.
View 6 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
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 20, 2005
I am trying to order a laptop from the Dell online shop but
everytime I try to press 'continue' after picking the options, I get
an error message in the lower left hand corner of the browser.
I'm using WIN 98SE with java enabled on my laptop.
The error log says:
Line: 1
Char: 1
error: object expected
code: 0
And this is the line which pops up when I place the cursor on the
'continue' button causing the above error:
javascript:next_page(Ƈ','c=us&cs=19&kc=6V602&l=en&oc=5100FS&s=dhs');
I would assume there's a bug in that line. Although there's little I
can do about it other than forward it to the Dell folks - my pgming
background has me curious as to what's causing this!
View 8 Replies
View Related
Jul 23, 2005
onClick="javascript:myFunction()"
or does it HAVE to be
onClick:"myFunction()"
I know 'javascript' is not necessary here, but just want to know whether to include it (which sometimes I do by mistake) is incorrect syntax or not..
View 1 Replies
View Related
Aug 12, 2005
I have this JavaScript that is supposed to show random products from my
database, and show something different every time you refresh or revisit.
But I keep getting an error - on my computer - that says Syntax Error in
Line 2.
There is no error on most other computers, and the products show, but
another script on the page, an article title scroller, stops - on most
computers, but not all. It says "no articles available".
I've tried the script on an asp page and a htm page, all by itself, but it
still doesn't work. I tried changing all kinds of settings in my browsers,
but nothing helps. I'm on XP, SP2, which I've heard has some problems
handling javascripts. I don't know if that's true, but if it is, I know that
lots of other people will have the same problem as me when they view the
page. Actually, I think it is a good thing, that my computer is pointing out
this error. I get the error message in IE6, but in NS8 and FF, I just don't
see the products. No error message.
Anyway, here are the first three lines of the script:
<%
if TRIM(request.servervariables("http_referer")) = "" then
%>
Using spellcheck, I found that referer is spelled wrong, it should be
referrer. I don't know if that is right for javascript (or asp?), but
correcting it didn't make a difference.
The script is JavaScript on an asp page, and it is called in an htm page.
Is the error obvious from the 3 lines?
View 8 Replies
View Related
Sep 12, 2005
How does one center text in an alert box? and how do you make the alert box
appear in the middle of the screen? I've seen it done, but my alerts have
text left justified, and the box is longer than i need.
View 1 Replies
View Related
Nov 13, 2006
I found this in one of my old scripts but I can't remember what the -0 was used for. I remember it was a shortcut method but I can't remember for what. Does this ring a bell with anyone?
var Pattern = /px/;
var T = paddingArry[0].replace(Pattern, "")-0;
View 5 Replies
View Related
Jul 20, 2005
Does the "semicolon insertion" really affect you if you format code as
function x (y)
{
// ...
}
instead of:
function x (y) {
// ...
}
The jslint page complains about lines ending in ) due to the nebulous
idea of "semicolon insertion". I have not reviewed the ECMAScript pdf
in great detail to try to pin this pretty-printing issue down. In
general, I find that code formatted in the "K&R" style (opening brace
on same line as if, while, function) confusing and difficult to read
compared with placing curly braces on separate lines.
On another subject, the difference between inner functions defined
explicitly versus defined using function expressions seems like a good
one for a FAQ. Under what circumstances does it make a real
difference whether you use function expression versus function
statement versus Function object?
View 1 Replies
View Related
Jul 20, 2005
Here is the code:
function fnSelectOption(fieldname)
{
document.mainform. + fieldname + .value = "value";
}
It obvliously bombs where I am trying to ref the param "fieldname". I
realize it is a simple syntax issue but I cannot seem to figure it out.
View 10 Replies
View Related
Oct 27, 2010
I have a text string that is a complete html doc. How do I tell jquery to parse that?
Variable theDoc holds the other html doc.
I tried:
var doc = $(theDoc);
If it is "this" doc it looks like: var x = $('table:contains('test')).html(); I tried: var x = doc.find('table:contains('resume')).html();
It keeps saying something is null.
So what is the syntax to look inside another doc , not the one the code is currently in?
View 2 Replies
View Related
Aug 10, 2010
What is the syntax for hiding div tag for safari, firefox, chrome.In my webpage i've 2 div tag, based on the condition i'll show any one at a time.Can any one give a syntax to hide div in all kind of browser.
View 1 Replies
View Related
Apr 7, 2011
What would the correct syntax be for this:
if('#loaded_max' == 3) {
loading = false;
}
View 3 Replies
View Related
Jul 23, 2005
Recently writing some code i cross over a problem using document.write:
View 2 Replies
View Related
Jul 23, 2005
Trying to debug someone else's javascript code. There is a line that
looks like this:
req = req.substring(req.length-2, req.length);
From what I can gather in their comments, they want to capture the last two characters of the string "req".
I'm guessing that the above line won't do that, and they want to change it to
req = req.substring(req.length-1, 2);
In other words, the parameters are starting position, and length. Is that correct?
View 6 Replies
View Related
Apr 3, 2006
I discovered this syntax on the google example of a client to their web
service.
function PagClass()
{
this.init();
}
PagClass.prototype = {
init : function() {
this.m_bInited = true;
this.m_nTotalRows = 0;
this.m_nFirstRowNum = 0;
this.m_nRowsPerPage = 0;
this.m_nNumPages = 0;
this.m_nReportid = 0;
this.m_nResultNumStart = 0;
this.m_strStart = "";
},
foo: function() {...},
bar: function() {...}
}
This seems like a very elegant way to create classes in javascript,
gives you a constructor and lists methods as comma separated
properties.
My colleague is suspicious that there may be excessive runtime overhead
associated with the prototype, property list way of doing this.
Anybody know for sure?
View 1 Replies
View Related
Dec 15, 2006
I'm looking at some code I do not understand:
var icons = new Array();
icons[""] = new GIcon();
icons[""].image = "somefilename.png";
I read this as an array of icons is being built.
An element of the array is an object itself but what is this syntax of
the consecutive double quotes inside the brackets ?
View 2 Replies
View Related
Aug 23, 2007
I had a look at sIFR.js code after parsing it and I have a question
about function syntax. For example
var f=function(){
// statements here
}();
What is the purpose if the second set of parentheses following the
closing brace? Is the intention to execute the function immediately
after it has been defined?
Most functions in sIFR.js do not have this syntax, but a few do.
View 1 Replies
View Related
Sep 11, 2007
var BN = {
foo: function() {
alert("hello world");
},
z: function() {
alert("hello world");
},
}
I would like to add a member moo to BN whose definition is
var moo = {"a":"A","b","B"};
How do I do it?
View 9 Replies
View Related
Jul 20, 2005
I know only little of javascript and have trouble with the syntax of a
function this is the function
function ClipBoard( VARIABLE)
{
holdVARIABLE.innerText = VARIABLE.innerText;
Copied = holdVARIABLE.createTextRange();
Copied.execCommand("Copy");
}
probably needless to say, but it doesn't work.
How can i get this function to work?
View 3 Replies
View Related
Nov 6, 2011
Was wondering, other then the syntax difference, should the below to bits not end up with the same result?
$("details").not("summary");
$("details :not(summary)");
View 2 Replies
View Related
Jul 16, 2009
addMainItem('index.html';'::Home';mwidth;'center';'';'';0;0;'');
The above line of code in my navbar is crapping at me for having bad syntax, something about lacking a closing brace. Clearly, I have a closing brace.
View 34 Replies
View Related
Jul 30, 2009
I just need someone to tell me what the proper syntax is for calling a perl sub from another perl sub.. in trying to use onClick to call a sub in Htmlform() .. but its not working... the cgi works fine.. the mySql parts work fine.. more specificallyprint start_html(-title=>'Lab 6',-scrip=>{-language=>'PerlScript', src=>'mySqlProg.cgi'});i dont know if the above is the corect syntax in relation to thisprint "<button type='button' value='view' onclick='show_entries();'>Show Table Values</button>";
#!/usr/bin/perl
use strict; use warnings;
use CGI qw/:all/;
[code]....
View 4 Replies
View Related