Search To Return Only .html Extensions
Feb 7, 2006I"m trying to do a search on a folder that contains both word docs and
html pages. I want the search to only return back the html pages.
Does anyone know the code for that?
I"m trying to do a search on a folder that contains both word docs and
html pages. I want the search to only return back the html pages.
Does anyone know the code for that?
trying to write a function where i can pass an array and string and replace the value in return. i.e
var inputStr = "010203040506070809111213141516171819";
i want to pass this value in function and replace each number (number ranges are 01-09 and 11-19 only) i.e if i pass 01 want to replace that with A,02 with B etc.. so problem is i would pass input string and pass back as string after replacing those values by running through the below function. wrote the following,cant seem to split my inputStr into 01 02 etc tried splice and split no luck :
[Code]....
i want to search the index.xml file throu diff input like combo box and input text shown in the search.html file and output the result in a tale.
search.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>Search</title>
<script type="text/javascript" src="search%20xml/search%20xml%20with%20mouseover%20table/searchindex.js"></script>
[Code]...
I'm new to ajax and coded a script that returns the result of a php file. It is fine if it is just text, but if it has html included it prints out the tags instead of treating it like html. How do you treat it as html? I've heard of innerHTML but was told it isn't viewed as standard compliant and some browsers don't even support it.
View 6 Replies View RelatedI'd like to announce release 1.0.7 of JNEXT (JavaScript Native
Extensions). JNEXT is an open source framework for securely accessing
the full range of native OS resources (files, databases, sockets etc.)
by using JavaScript from within a Web Page. It is light weight, cross
platform, cross browser and designed with simplicity in mind....
Does anybody know of a good firefox extension tutorial?
Basically I have an XML list of things
<term>bleh</term>
<replacement>blehsky</replacement>
and I want to make the extension replace every occurance of bleh on the webpage with blehsky.
I can handle the javascript to do this, but I don't know where to start in making it into an extension.
Im just getting started with Jquery, and now i have a little problem. I tried to search several solutions but none of them seems to work.
[Code]...
A simple one that is fooling me too much.The following function is returning a numeric value. I want to insert this value in html code. How can I do that?
Code:
<script type="text/javascript">
function myFun() {
[code]....
I'm trying to create an extensible class with private members.
Suppose I have the following:
Code:
Obviously, only "y" should be available to instantiations:
Code:
But how can I now extend this class and still access the private properties inside the extension?
Code:
How do I access x there? The someOtherFunction extension is part of the prototype, so it should be in the same scope as someFunction, no?
i have a function to load text files.
function load(n){textfile=n;if(n.indexOf("#")!=-1){theleft=n.indexOf("#")+1;textfile=(n.substring(theleft))}
document.mycall.load(textfile+'.txt');origString=textfile;
and it only loads a files with .txt extensions. how to change this function to load files with .doc and .nfo extensions also.
I couldn't find a single thread with the creme de la creme of String prototype extension methods, so I figured I'd start one. Here we go!
String.prototype.lTrim = function () {
return this.replace(/^s+/gm, "");
}
String.prototype.rTrim = function () {
return this.replace(/s+$/gm, "");
}
String.prototype.trim = function () {
return this.rTrim().lTrim();
}Obviously, this one's easy to understand. I'm using multi-line mode so as only to get rid of spaces and tabs before and after words. Single-line mode would replace any newline/carriage return characters as well.
String.prototype.capitalize = function () {
return this.replace(/[a-z]/g, function (str, n) { return str.toUpperCase(); });
}
String.prototype.toCamelCase = function () {
return this.replace(/s[a-z]/g, function (str, n) { return str.toUpperCase(); });
}
String.prototype.unCamelCase = function () {
return this.replace(/[A-Z]/g, function (str, n) { return " " + str.toUpperCase(); });
}This is something I needed today, to turn a camelCased variable value into its Header Format. While I was at it, I wrote the un-do-er.
I have been using Frontpage to design web sites and know that online-forms can be created using Frontpage, but the host must have Frontpage Server Extensions installed...
...I was wondering if the online forms were simply CGI scripts??
If so, could i not get DreamWeaver Ultra Dev and write the CGI scripts in there? - I think DreamWeaver is capable of this?
Therefore, if a server supported CGI scripts and i had to pay extra for FRONTPAGE EXT. then i could bypass this problem by using CGI scripts...
...does this make sense? If not, why not?
Website for a external search engine for your website, or give me a HTML code or CSS code?
View 1 Replies View RelatedI've painted myself into a corner, and I can't use any server-side solutions.
With some help, I've been working on a script on x.html that searches for a specific "image Y" within "Y.html" (inside an iframe). Then the script replaces the "Image x" url to the url of "image Y".
It drills through a specific div, to a specific span, to find this image Y. I have it this way, because it's a pre-built content management system that hasn't given me the ability to show the image on another page. I need to do this several times on one html file, so I'm running into huge load times, and there seem to be numerous clashes with servers and locking up. So I'm hoping there's a way to just avoid iframes and achieve the same result.
Here's the script that I've got, to help understand what I've done.
[Code]...
I have a button in my html form that will process some functions when user clicks on the button. The problem is after processing the functions, the result is not displayed in the form where I want it to be displayed. I want to ask whether we can create table in the function and display the result in the table row/column but in the same form. Is this possible to be done? And how to do this?
In this form cpiM, the input button will call function showIndex.
<tr>
<td><input type="button" value="Enter" onclick="showIndex(document.cpiM.currFrom.options.selectedIndex, document.cpiM.currTo.options.selectedIndex, document.cpiM.base.options.selectedIndex, document.cpiM.country.options.selectedIndex)">
[Code]...
Script works on the first attachment but not the other two?
<script type="text/javascript" language="JavaScript"><!--
function ExtensionsOkay() {
var extension = new Array();
var fieldvalue = new Array();
fieldvalue[0] = document.customApp.attachment_1.value;
fieldvalue[1] = document.customApp.attachment_2.value;
fieldvalue[2] = document.customApp.attachment_3.value;
extension[0] = ".doc";
extension[1] = ".docx";
extension[2] = ".txt";
extension[3] = ".pdf";
// No other customization needed.
for(var f = 0; f < fieldvalue.length; f++) {
var thisext = fieldvalue[f].substr(fieldvalue[f].lastIndexOf('.'));
for(var i = 0; i < extension.length; i++) {
if(thisext == extension[i]) { return true; }}
alert("Your upload field " + f + " contains an unapproved file name.");
return false;
}}
//--></script>
When introducing custom functionality to HTML elements we either use existing attributes to pass configuration parameters (like beetle's fValidate (http://www.peterbailey.net/fValidate/)) or invent our own (like my Tooltips (http://www.vladdy.net/webdesign/ToolTips.html)). While this method is ok for small amount of configuration information, it is not that flexible (you need to edit DTD) and becomes combersome when large amount of configuration parameters is needed.
I figured a more convinient way is to use a CSS like string to pass configuration parameters:
<div myextension="parameter1: value1; parameter2-subparameter1: value2.1; parameter2-subparameter2: value2.2"> </div>
Then initialization routine would contain:
if(myExtensionParameters = divElement.getAttribute('myExtension'))
divElement.myExtension = new myExtensionObject(divElement,myExtensionParameters);
Definition of possible parameters and their values can be done using an array of regular expressions:
myExtensionParamDefenitions = new Array();
myExtensionParamDefenitions['choiceparameter'] = /^s*(value1a|value1b|value1c)s*$/;
myExtensionParamDefenitions['stringparameter'] = /^s*(w+)s*$/;
myExtensionParamDefenitions['integerparameter'] = /^s*(d+)s*$/;
Constructor for the myExtensionObject would containd a parseParameters function:
function myExtensionObject(divElement,myExtensionParameters)
{ this.params=new Array();
parseParameters(this.params,myExtensionParamDefenitions,myExtensionParameters);
//Verify parameter initialization, if you like
str=''
for(e in this.params) str+= e + ': ' + this.params[e] + '
'
alert(str);
//Do whatever you have to do...
}
Function parseParameters has the following code:
function parseParameters(object,definitions,parameters)
{ paramEntries = parameters.split('');
for(var i=0; i<paramEntries.length; i++)
{ paramEntry = paramEntries[i].split(':');
if(paramEntry.length == 2)
{ paramName = paramEntry[0].replace(/^s*([w-]+)s*$/,'$1');
if(definitions[paramName])
{ res = definitions[paramName].exec(paramEntry[1]);
if(res[1])
object[convertCSSName(paramName)] = res[1];
}
}
}
}
Where convertCSSName function converts CSS type name (background-image) to javascript name (backgroundImage)
function convertCSSName(cssName)
{ sn = cssName.split('-');
rs = sn[0];
for(var i=1; i<sn.length; i++)
rs += sn[i].replace(/^(w)(w*)$/,function(str,p1,p2,offset,s){return p1.toUpperCase() + p2;})
return rs;
}
As a result you have params array of myExtensionObject object populated with validated entries. Changes and expansion is done by simply editing myExtensionParamDefenitions array.
PS: The functions are coded more for clarity rather than for brevity - I'm certain there are ways to improve the implementation.
I have a search field on the website, and when I type a word to search, it search good, but after preforming the search, the search term from search text field disappears and become the default 'Search' word.
How can I make search term stay in search field after preforming a search ? For example, when I type into the search field 'JavaScript' I want that term to stay in search field and after the search is done.
I am using the ajax method in JQuery to return an XML response from a URL location. The method looks like the following:
$.ajax({
url: '../DSMO/lb.asmx/GetAvailableDocListAuth',
cache: false,
type: 'POST',
[Code].....
OK so if I use repsonseText responseXML or just try and traverse msg it will not work. The problem is the body of my XML response, all of the tags ('<' and '>') are getting escaped to html entities ('<' and '>') So it becomes a malformed XML document that is not readable. I even tried using the Javascript function replace to go through and replace with no luck.
Even stranger if I access the web service through the browser, the XML is just fine!
The server is Windows Server 2008 running IIS 7 and I am programming of course in HTML and newest version of JQuery.
The browser I am testing on is Firefox with FireBug.
All is on the title, sorry for my english, i'm french :) I have an html page with style
<style>
#mydiv {
margin-left:auto;
margin-right:auto;
width:250px;
}
</style>
with jquery, i try to get the margin-left ($('#mydiv').css('margin-left'), but the function return 0px, unable to retrieve the good value (auto) anyone has idea to retrieve the value "auto" when margin-left is "auto" ?
I have a question about the jquery .html() function.
Here is a sample code ...
So when I call something like $("#testHtmlFunction").html(), then it returns me the following
Which is correct and expected. So everything is fine and dandy till now.
Now, let's say the user has change the input field text from "Sunil" to "Changed". So I will expect the same html() function call to return me something like
But it does not and keeps returning the same old stuff.
So my question is whether there is any other method which can give me the "changed" html code. And this happens not only for text fields but also for select and other elements too. So in other words, I need to be able to read the html code including selected, checked attributes etc. once the user has input responses on the form. Is this possible?
I found this for instant search :
demo : [url]
index.php
Now i just want to edit one thing, when you search for something, results are shown under the search field, when you click on each result, goes to a link.
I want when clicking on a result, not going to link, just show that result string on the search field. where should i edit in script?
I have created a similar smart search like yellowpages:[URL]... Here is the problem I have with mine:
Lets say I search 'Attorneys' I start typing 'Att' ... then 'Attorneys' shows up in the smart search so I click on it and press enter. The next time I start typing 'Att' my browsers saved search field pops up over the websites smart search. Here is an image which might help explain the problem a bit more:
I have one html-file where the user inserts a search path for an excel file. When the user clicks the button the data in the excel file should be presented in a <TABLE>. (Yeah, I know, activex only works in IE .. but that's good enough for this project)
The problem is .. I started out with a "fixed" search path for the excel file, so I didn't have the code in a function. That worked just fine. Once I added the function {} around the code it wouldn't work, it works just fine if I comment out the form-part and the function-part, and give the search path, of course.
It also works just fine if I use the function and form, but remove the <TABLE>- and <TR>-rows
[Code]...
how is clearing search box with click on search results?
jquery:
var strToMatch = $("#hotel").val();
$('.list_name p').each(function () {
if (this.innerHTML.indexOf(strToMatch) > -1) {
[Code]....
I have chosen to use Google Custom Search with my website and was given the following code, my question is, how can i pass a search query from my homepage which has a standard form on there to the search page which holds this code?
I am given a search box within this code but would prefer to use my own on the homepage...
<div id="cse" style="width: 100%;">Loading</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load('search', '1', {language : 'en'});
[Code]....