473,378 Members | 1,482 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

calling html file from javascript

82
Hi,

Is there any way to call html file from a javascript.

What I want to do is as following:

1) send information to sever and checkit by using Javascript.
2) if everything is OK. call another html file inside the same javascript.

How it can be done.
Mar 11 '08 #1
11 17124
gits
5,390 Expert Mod 4TB
hi ...

please explain a little bit more what you mean with:

' ... call another html file inside the same javascript ... '

kind regards
Mar 12 '08 #2
hsriat
1,654 Expert 1GB
Hi,

Is there any way to call html file from a javascript.

What I want to do is as following:

1) send information to sever and checkit by using Javascript.
2) if everything is OK. call another html file inside the same javascript.

How it can be done.
Is it something like Google's login?
Mar 12 '08 #3
vee10
141 100+
Hi ,

u can call another html file by using window.navigate("htmlfile.html") in javascript


Hi,

Is there any way to call html file from a javascript.

What I want to do is as following:

1) send information to sever and checkit by using Javascript.
2) if everything is OK. call another html file inside the same javascript.

How it can be done.
Mar 12 '08 #4
gits
5,390 Expert Mod 4TB
Hi ,

u can call another html file by using window.navigate("htmlfile.html") in javascript
that is certainly IE only and so it is not standards-compliant - i woudn't recommend that method unless you are sure to code for IE only (may be an intranet-solution) ... but to solve the problem we first have to know exactly what the requirement is ...

kind regards
Mar 12 '08 #5
raknin
82
The situation is:

I want to move from one html file to another and stay in the same window.

The process that I am going through is as following:

I am submitting the result of the page throgh javascript to the server using AJAX and PHP.
if everthing is fine I want to load a second html page instead of the current one.

I think this is clear
Mar 13 '08 #6
gits
5,390 Expert Mod 4TB
then let your server send an ok or an url and set the location.href of the window ... alternativly you could send the html and replace the innerHTML of the documents body ...

kind regards
Mar 13 '08 #7
raknin
82
then let your server send an ok or an url and set the location.href of the window ... alternativly you could send the html and replace the innerHTML of the documents body ...

kind regards
Unfortunately the location.href is not working maybe I don't use it correctly I am using window.location.("http://www.xx.com/xxx.htm") but nothing happen I not taken to the new page I check it on IE and FF.

I check it with the document body and it doesn't work for me.

Thanks anyway
Mar 13 '08 #8
gits
5,390 Expert Mod 4TB
try this:

Expand|Select|Wrap|Line Numbers
  1. window.location.href = "http://www.xx.com/xxx.htm";
kind regards

ps: note that this loads a new page and breaks out of the 'ajax-paradigm' to reload content in the background ...
Mar 13 '08 #9
raknin
82
try this:

Expand|Select|Wrap|Line Numbers
  1. window.location.href = "http://www.xx.com/xxx.htm";
kind regards

ps: note that this loads a new page and breaks out of the 'ajax-paradigm' to reload content in the background ...
Gits,
Thanks this is exactly what I was looking for I will try it and let you know
Mar 14 '08 #10
gits
5,390 Expert Mod 4TB
no problem :) ... post back when there are problems with it ...

kind regards
Mar 14 '08 #11
raknin
82
Thanks gits it is working perfect.
Mar 15 '08 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Pjotr Wedersteers | last post by:
Hi, When I include a script in my html I don't get any output back in the calling page. The script is on a remote location for the html page. Example given: myscript.php: <?PHP echo...
1
by: Timmy | last post by:
Hi, Is there anyway to read an html file into a javascript variable or execute a script src and load that output into a variable in the calling page? Thanks, Tim
2
by: Georg Andersson | last post by:
hi i've created a html-file containing a frameset. the document in one frame enables the user to change the content of the other frames. but i want to modify the current html-files in the frame...
11
by: Jake j | last post by:
Yes, this is a simple and straightforward thing to do as long as the .js file doesn't use a function. When I try a script with a function in a js file I can't get it to work (though it works fine...
1
by: amit | last post by:
Hello Group, Does anybody know how I can have a global variable in an HTML file? for instance, I have a fuction (called aFunction() here) and during a mousedown or up event the function is going...
8
by: Peter Gustafsson | last post by:
Hi I have a HTML-only file, and asp file that do a databasequery. How can I do a query in the html file, like this: DBLookup("2"). The asp file execute the query and respond with the result....
4
by: Garg | last post by:
Hi All, Can you suggest me the a good editor fot HTML and Javascript. It will be good if that also support JSP. thanks Tarun Garg
2
by: kenny bones | last post by:
Hello, I'm new here and I'm troubling with something. I'm working on a website which have a treemenu. I've gotten the menu to work alright but I want the DIV which contains the treemenu to have a...
2
by: ray | last post by:
I have a html file stored as the D:/proj/test.html. In the html file I wish to load a javascript file---test.js which is stored in the same directory as test.html. <!DOCTYPE HTML PUBLIC...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
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...
0
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.