Solved

DotNetNuke Text\HTML Javascript Redirect

Posted on 2010-08-31
7
1,035 Views
Last Modified: 2012-05-10
Hello,
I am sure this is a very stupid question, but I am rather new to web coding.
I am trying to make a simple little form in DotNetNuke with a Text\HTML module that will allow me to have a couple text entry boxes, and append those as querystring variables to a javascript redirect button. When I try do this with window.location.replace('URL') in my onclick, it just refreshes back to the same page (not the page I want to redirect to). when I use window.open('url') that works, but it goes to a new window.
What am I doing wrong?
0
Comment
Question by:markterry
  • 4
  • 2
7 Comments
 
LVL 6

Expert Comment

by:thaytu888888
ID: 33574082
- Try window.location = yourURL;
0
 
LVL 1

Expert Comment

by:talktodhand
ID: 33574123
function redirect()
    {
        location.href = "newURL";
    }
0
 
LVL 6

Author Comment

by:markterry
ID: 33574208
Neither work, also alert("Hello World!"); does work. I am starting to think there is something in the CMS stopping this code.
also thatyu888888, I thought windows.location causes a loop when people use the back button.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 6

Author Comment

by:markterry
ID: 33574260
okay, new news... window.location.redirect works in IE, but not Chrome or FireFox. So kinda good, but obviuosly I would want it to work in all browsers.
0
 
LVL 1

Accepted Solution

by:
talktodhand earned 500 total points
ID: 33574306
Hi,

works on IE,Chrome and FireFox too....
I have tried following code:

<html>
<head>
<script>
function redirect()
{
      window.location.href="http://www.google.com";
}
</script>
</head>
<body>
<input type=button onclick=redirect();>
</body>
</html>

Hope it will help.
0
 
LVL 6

Author Comment

by:markterry
ID: 33582582
that indeed does the trick talktohand. adding the window before location.href seems to be working.
0
 
LVL 6

Author Closing Comment

by:markterry
ID: 33582590
Thank you for your help.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now