Hi,
I am trying to write a javascript on Windows XP for my website that is supposed to perform a text search on an external page and return a result which, based on the result, will play a certain audio file. The script that I am writing is not working, I keep on getting redirected to the external page in which I am trying to perform the search, and I am getting numerous javascript errors, such as 'member not found', 'body is null or not an object', 'expected ]', and 'expected ;'.
I have been trying to get this script to work all weekend, and it is getting frustrating. Any help to get this script functional would be greatly appriecated. 3 versions of the script are attached below.
jagasker
-------------------------------
Script Version 1
------------------------------- -
var adv1=[document="http://www.weather.gov/alerts/pa.html"].body.createTextRange()
-
var query1a=adv1.findText('Carbon')
-
var query1b=adv1.findText('Tornado Warning')
-
-
if (query1a == true & query1b == true)
-
document.write('Tornado Warning in effect')
-
else
-
document.write('No Alerts')
-
--------------------------------
Script Version 2
-------------------------------- -
var adv1=[window.location="http://www.weather.gov/alerts/pa.html"].body.createTextRange()
-
var query1a=adv1.findText('Carbon')
-
var query1b=adv1.findText('Tornado Warning')
-
-
if (query1a == true & query1b == true)
-
document.write('Tornado Warning in effect')
-
else
-
document.write('No Alerts')
-
---------------------------------
Script Version 3
--------------------------------- -
var doc="http://www.weather.gov/alerts/pa.html"
-
var adv=doc.body.createTextRange()
-
var query1a=adv1.findText('Carbon')
-
var query1b=adv1.findText('Tornado Warning')
-
-
if (query1a == true & query1b == true)
-
document.write('Tornado Warning in effect')
-
else
-
document.write('No Alerts')
-
1 1128
All of the script versions have the wrong syntax. You need to load the page in a window, frame or iframe and then try to access it. However, since it's not from your domain, the browser will give a permission/access denied error. To work around that, load the site from your domain using some server-side code, or just code this on the server-side.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Web Science |
last post by:
Site and Features: http://www.eigensearch.com
Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
|
by: neblackcat |
last post by:
Would anyone like to comment on the following idea?
I was just going to offer it as a new PEP until it was suggested that
I post it here for comment & consideration against PEP 308.
I'm far...
|
by: Web Science |
last post by:
Site and Features: http://www.eigensearch.com
Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
|
by: Web Science |
last post by:
Site and Features: http://www.eigensearch.com
Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
|
by: Web Science |
last post by:
Site and Features: http://www.eigensearch.com
Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
|
by: Web Science |
last post by:
Site and Features: http://www.eigensearch.com
Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
|
by: Web Science |
last post by:
Site and Features: http://www.eigensearch.com
Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
|
by: Web Science |
last post by:
Site and Features: http://www.eigensearch.com
Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
|
by: DQ dont quit |
last post by:
I'm currently working on a ASP.Net / C# / SQL 2000 project that involves the
entering of keywords, that a web user enters, and then searching MSWord
documents for those words. This information...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |