Referring To Current Line Number

Apr 23, 2003

Does anyone know of some way of referring to the current line number in a javascript? This would be a handy debugging tool: whenever a function threw an exception, it could say "ERG! Something wrong on THIS line".

View 3 Replies


ADVERTISEMENT

Position Cursor In A Textarea On A Line Number?

Mar 27, 2009

I want to write a function that will let me position my cursor in a textarea on a line number. I would need to use on a textarea component to do this.

I'd like to popup a dialog in JS so I can ask the user what line number and then have the cursor go to that line - is this even possible?

View 4 Replies View Related

Try-catch Error Handling -- Display Line Number?

Jul 20, 2005

I need help finding where an error is occuring in my code. I use a
try-catch block like this in my global.asa:

} catch (e) {
Application('errormsg') = ("An exception occurred in the script. Error
name: " + e.name
+ ". Error description: " + e.description
+ ". Error number: " + e.number
+ ". Error message: " + e.message); }

And this is what is SOMETIMES returned when I display
Application('errormsg'), the rest of the time, it works:

An exception occurred in the script. Error name: Error. Error description:
Path not found. Error number: -2146828212. Error message: Path not found

But I don't know which path is not found! (I'm using the filesystem object
and importing data from a file into SQL.) Is there a way to display the
line number of the error or more details? Or do I just have to try to catch
the error by going through each bit of code?

View 3 Replies View Related

JQuery :: Document Transveral - Used .prev To Get The Line ID But Can't Seem To Get ID Number

Feb 12, 2011

I'm playing around with edit in place and have a list of information that is generated by a php loop. Each list has a unique ID number at the top that i need to send back to my php script. I've put the ID number in a hidden form field at the top of every list and i'm trying to read it using .val() I've used .prev to get the line ID but can't seem to get ID number.... I thought it would be something like this but i can't seem to figure it out... i $(this).find('.Id:first').val(); usally work my way though stuff but this is making my head hurt.....

View 6 Replies View Related

JQuery :: How To Get Current Sibling Number

Aug 23, 2010

I've made a function for getting a ID for each sibling in a tree. Lets look at this DOM:
<ul>
<li>Five</li> //sibling ID 1
<li>Six</li> //sibling ID 2
<li>Seven</li>//sibling ID 3
</ul>

Here is the function:
function getSiblingId(elm) {
return $(elm).siblings().size() -$(elm).nextAll().size() + 1;
}

And here is how I use it:
var id = getSiblingId($('ul li:first-child')); // id = 1
Is there a more elegant way to get the same result? The work done in the getSiblingId-function has a lot of overehead.

View 1 Replies View Related

JQuery :: Cycle - Get Current Slide Number

Sep 23, 2008

I have a page has multiple slide shows in it, and have written a little script to loop over and implement the function. I'd also like to diplay the current slide number under each sideshow ("2 of 5 images"). I tried a few ways to go about this (using the variables that should be floating around pager or prevNextClick). Neither worked. In the past I've had success with idx etc

[Code]...

View 20 Replies View Related

Read Text File Line By Line And Separate Special Characters?

May 25, 2010

how to read a text file using javascript line by line and separate from special characters in it. for example

Text.txt has

001203=Line one=abc.html
024353=Line two=xyz.html
092434=Line three=hjf.html

i want each column in an array like { 001203,024353,092434 } so total 3 arrays.

View 14 Replies View Related

JQuery :: Get The First Line Offset Of Inline Elements With Multiple Line?

Feb 22, 2010

getting first line coordinates of multiple line inline element.

Example HTML
aaa bbb ccc ddd <span id="target">eee fff ggg
hhh iii jjj</span>kkk lll mmm nnn ooo ppp qqq
$(document).ready(function() {

[Code]....

Assume that span#target has a line break, when I see a browser. Then I click span#target, above function returns the head of coordinates which second line ("hhh") has. I want to have the coordinates which first line ("eee") has. How can I get that?

View 1 Replies View Related

How To Set The Referring Url

Mar 31, 2007

this there any var to set the referring url manualy?

is there anything at all so i can put in this var my own value, like
when i paste an address on the firefox url and the page will set some
value i want and it won't be blank.

View 3 Replies View Related

Referring Web Page

Feb 3, 2006

Without having to create a cookie....I would simply like to "grab" the referring web page of visitors to my site.

I am going to call this script from a small flash Action Script file but that doesn't really matter at this point.

If anyone can answer this simple question I'd appreciate it. I have done a search but could not get a direct answer within the first 4 pages.

View 2 Replies View Related

JQuery :: Reading File Line By Line?

Jan 11, 2012

reading file in jQuery. Please if anyone knows how to write tome or to the website.

$.get("data/zelis.si.txt",function(data){
$.each(lines, function(n,line){
$.ajax({

[code]....

View 7 Replies View Related

Allowing Access From One Referring URL?

Mar 5, 2010

I create eLearning materials which are given away as a communty service to help people improve their health. A typical eLearning project has a few educational screens (using a Learner Management System-LMS-template) and an interactive exercise (on an external web page-htm or html-usually accessed by button which navigates to the exercise's URL).

The interactive exercise should only be accessed from inside the eLearning lesson using the button, because it requires understanding of the way it works plus important cautions to assure proper use. I need to prevent the use of the URL outside of taking the lesson (for example, someone taking the lesson acquires the exercise's URL from their browser history and then may give this to others who access the exercise directly-without necessary knowledge and cautions).

I tried document.referrer, using JavaScript. Using the referrer URL from inside the lesson and adding the JavaScript to the exercise's htm code worked OK in FF, but not in IE 8. In FF, if the referrer was not the correct single URL from inside the lesson, then it redirected; if the correct URL, the exercise appears.

The JS code follows:

<script language="JavaScript" type="text/javascript">
<!--
var oksite = "http://www.mysite.com/xyz/courseidxxxxx/yyyy/zzz.html";

[code]....

In IE 8, I was not able to get it to work. Using an alert, I noticed that the referrer in IE 8 was blank.My web hosting (GoDaddy) is a shared Windows hosting. I would have to upgrade from IIS6 to IIS7 to use PHP. Bigger challenge: I've never used PHP. If possible, I would prefer to use JS. But, I am open to any suggestion that will help.I am also wondering if part of the IE 8 issue is that I am using IE 8 X 64?

View 1 Replies View Related

Capturing Referring URL With Cookie?

Apr 15, 2010

I am using a third party shopping cart service written in php. I don't have access to the php code so I decided to use javascript to write a cookie. What I'm trying to do is have the cookie capture the referring URL and then keep it for a day and have it follow where ever the visitor goes in the shopping cart. Then when they check out, the referring URL will populate a form field and be returned as part of the form results. This way I can track where my visitors come from. My code is below and I'm adding it to the file designated as the head section. (The files I have access to must use some form of include but I can't use php in them - just html and javascript. I've tried.)

I have an alert in the code that suggests something to do as well as set the cookie. The alert comes up and the cookie is set but when you go to another page, the alert comes up again and another cookie is set. I just need to have it set once so when they fill out the order form, I'll know where they came from.

<SCRIPT LANGUAGE="JavaScript">
cookie_name = "dataCookie";
var referred;

[code]....

In the body I am reading it with a form field of

<SCRIPT LANGUAGE="javascript">
document.write("<FORM>")
document.write("Originally Referred by:")

[code]....

View 1 Replies View Related

Append String To Referring URL?

Apr 1, 2011

I want to append a string "&sid=xyz" to the current page URL if the referring URL comes from site [URL]. I have the following code -

var query = location.search.substring(1);
if (document.referrer.indexOf(/xyz/) > 0) {
query = query + "&sid=xyz";
}

However, the string is not being appended.

View 1 Replies View Related

Referring To Parent Object

May 6, 2003

I have an object, "A", which contains another object "B", as an attribute.

How do I get a hold of Object "A" from within "B"? i.e. I need to refer to the object that B is stored inside from within B's code. Is there some superclass equivalent of 'this' that I don't know about? ('parent'?!)

View 2 Replies View Related

Determining Referring URL And Search Term

Feb 4, 2006

I have very limited experience with Javascript. Can someone refer me to
info on how to determine the referring URL and the search term used by a
visitor just prior to his landing on my web page?

View 1 Replies View Related

Eliminate Referring Page When Using GetURL?

Nov 1, 2006

Is there any way to have the referring field blank when using the GetURL command?

View 1 Replies View Related

Redirect Someone From A Referring Domain To A Webpage

Jul 20, 2005

I'm trying to redirect users from a specific domain to one of my
webpages.

So, in my example, anyone accessing my index.html from the
*btinternet.com domain (allowing for wildcards!) will be redirected to
"update.htm". Code:

View 1 Replies View Related

Referring Variable In Input Text Value?

Jun 23, 2009

I've been facing a problem assigning a javascript variable to an input text's value attribute.

My code is as follows:
var moduleCd = document.getElementById('client.moduleCd').value;
var productSelectLen = productSelect.options.length;
for(var i=0; i<productSelectLen; i++)

[Code]....

look at the bold italic marked text where I want to assign the value of variable moduleCd.

View 1 Replies View Related

Referring To An Already Defined Property In Object Literals?

Jan 9, 2010

I'm using closure to make a function return an object in the form of the literal.

function myFunction() {
return {
a : 'foo',

[code].....

View 2 Replies View Related

Read Txt File Line By Line?

Jul 7, 2010

How do I read a local text file line by line, one line at a time. I got upto opening a file, and can read whole file at a time. But I want to read just one line at a time. May be have a counter of lenght of the file and read only the counter number line at a time.

<SCRIPT language=JavaScript>
var fso = new ActiveXObject( 'Scripting.FileSystemObject' );
f = fso.OpenTextFile( "c:\mytextfile.txt", 1 );

[Code].....

View 2 Replies View Related

Submit/return To Php When Moving From Table Line To Table Line?

Jan 13, 2011

I have a user that insists they have web applications that do this, and wants the one I'm building to do it too...

You have a table on an html form. As the user changes one or more fields in a table row and moves to the next line, the changed row should AUTOMATICALLY be sent back to the server and updated in the database.

If the user moves BACK to a line that's already been changed, and changed a field, a popup should display and ask "if the user really wants to change the field". If so, again, it should AUTOMATICALLY be sent to the server and updated in the database...

Ignoring the horridness of making that many round trips to the server and banging the database for every line, is there a way to AUTOMATICALLY do the equivalent of a submit and post the changed table row back to the php script?

View 3 Replies View Related

Bookmarklet Parse URL - Take The Current URL Of The Page And Open A New Window With A URL Based On The Current Page?

Mar 16, 2009

I'm trying to create two bookmarklets:

1. Take the current URL of the page and open a new window with a URL based on the current page. Some examples (I use "->" to mean "this URL turns into that URL"):I plan to use these bookmarklets in sequence, first pressing 1 to log into the CMS, then pressing 2 to edit the current page.

View 5 Replies View Related

This.parentNode - Access The Elements Of The Form Without Referring To Them By ID As The Whole Form Is Intended To Be Cloned

Feb 16, 2011

I've put together what I think is an illustration of my problem at [URL] Quite simply, I need to be able to access the elements of the form without referring to them by ID as the whole form is intended to be cloned. I intended to do this using parentNode and childNodes[] together with the 'this' keyword. My understanding of 'this' in this context is that it should refer to the HTML element calling the function, i.e. one of the radio button inputs. However this gives the error "Error: this.parentNode is undefined"

View 1 Replies View Related

Best Practice For Referring To Node's "parent" JS Object?

May 10, 2011

Consider the following simplified example javascript code...

What's the "best" way to write that onclick method in its current context? I can think of a few ways to do it -- but they all seem fairly "dirty."

Have I gone stupid?

View 8 Replies View Related

Script That Is Supposed To Check If A Number The User Guesses Is The Same As The Randomly Generated Number?

Nov 11, 2011

I have this script that is supposed to check if a number the user guesses is the same as the randomly generated number.Problem is that the random number generated at the start of the program keeps on changing everytime I click on the "Check if I'm right" button, the random number gets generated again and I never ever get to reach the correct answer

HTML CODE
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

[code].....

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved