Try something like this...
if ( window.location.toString().indexOf("myPage.html") > -1 ) {
window.onbeforeunload...
}
Try something like this...
if ( window.location.toString().indexOf("myPage.html") > -1 ) {
window.onbeforeunload...
}
Are you sure you are closing the connection in every case? For the description of the error you might be letting the connection open.
Sorry mate, I really didn't understand what you want.
You want to fill an datagrid only with columns without data? What's the point? The datagrid would be empty.
This page is the same page that show the HTML? If so, all this code is being executed before any user interaction...
I suggest that you create an hidden input to know what do to... example:
<?php
if ( $_POST["formAction"] == "insert" ) {
// Insert code goes here
}
?>
<input type="hidden" name="formAction" value="none"/>
<button type="submit" onclick="document.form.formAction.value = 'insert'; return true;">Send</button>
Hi, first of all, put some description at your post, don't just drop the code.
So the problem seems to be that you can execute the stored procedure, right? Do you have permission to do so with the account your are logged in? Who is the owner of the SP? Try using the fully classified name like 'dbo.regionSelect'.
The App creates the DB and the tables, but it drops only the tables? If so, on the second time isn't it trying to create an DB that already exists?
And when the second project is created the first project tables are dropped, so the first project isn't available anymore?
Wouldn't it be better if the project tables were distinct? I mean, use a prefix... project_1_table_1, project_2_table_1...
What backend language are you using?
If you were able to show the list in HTML, just use an JQuery UI Theme to make the look and feel better.
I was not able to undertand what you area trying to do... but let me explain to you what your code is doing...
// Every TR inside .contact-names will have and double click event listener
$(".contact-names tr").live("dblclick", function(){
// Name will be any content displayed inside the row
var name = $(this).text();
// Every .input-name will have the value 'name', regardless of where the input is
$(".input-name").val(name);
// 'msg2' will be appended to every .tr
$(".tr").append(msg2);
// Any content inside the row clicked will be removed
// This doesn't make much sense, because the 'msg2' appended will also be removed
$(this).empty();
});
Where do you call the initialize function?
The error is telling you that you are trying to set the header after you started the output.
That's because you can't make AJAX request to different domains.
Take a look at this: http://stackoverflow.com/questions/3506208/jquery-ajax-cross-domain
I ain't sure, but I think you can't do it with backup (.bak).
What you can do it's generate scripts from the 2008 to the 2005:
1.Right click on the DB -> Tasks -> Generate Scripts
2.Select all the objects
3.Click Advanced
3.1.Change Script for Server Version: SQL Server 2005
3.2.Change Types of data to script: Schema and Data
If you don't have an working version of your DB in a 2008 enviorement, you'll need to create one.
Hope it helps.
You can't really make transitions between two pages, but you can give a better impression with something like this.
// Hide your main div when leaving the page
window.onbeforeunload = function() {
$("#myMainDiv").hide('fade');
};
// Shows your man div when loading the page
window.onload = function() {
$("#myMainDiv").show('slide');
};
I'm not sure, but I think this would work (C#):
object[] codeString = {"$('#practices).change();"};
webBrowser1.Document.InvokeScript("eval",codeString);
You can't use the same id item for all the objects. The method getElementById always returned only the first object with that Id.
The <a> object doesn't have an value property. To get the text you need .innerText;
Try those changes:
$hint=$hint . "<br /><a id='item' href='javascript:void(0)' onClick='add(this)'>" .
$g->item(0)->childNodes->item(0)->nodeValue . "</a>";
And
var i=0;
function add(objA){
i++;
var title = objA.innerText;
var node = document.createElement('div');
node.innerHTML = '<input type="checkbox" id="check' + i + '" name="check' + i + '"><label for="check' + i + '">' + title + '</label>';
document.getElementById('container').appendChild(node);
}
Put an alert($('.showproduct').find("div.product").length);
on the showProductPage function and see what it says.
The problem is that you are using the selector .image but it doesn't exist on your html.
Try this
function showProductPage( pageNo ) {
var perPage = 2; T
var start = pageNo * perPage;
var end = start + perPage;
$('.showproduct').find("div.product").hide().filter(function(index) {
return ( (index > (start-1)) && ( index < end ) );
} ).show();
}
The returned products. What does the var data hold?
I'd suggest one of the two: PHP + MySQL or .NET + SQL Server
Both can achieve what you're looking for.
The function showProductPage is fine.
Post one example of the data content.
One thing, you don't need '<\/div>', just '</div>' is fine.
You need to add your logic that will define which option must be selected, then you set it to selected like this:
<select name="mySelect">
<option value="1">First Option</option>
<option value="2" selected>Second Option</option>
</select>
I never used it, because I don't think it's functional. It sure is pretty and nice, but lack usability.
I'd use to build institucional websites, but I mostly work with BI systems.
I suggest you use jQuery UI to achieve this, it'll be very easy.
Take a look in this demo, it's almost what you want: http://jqueryui.com/button/#splitbutton
This demo uses 3 jQuery UI feature: Button, Menu and Position.
I've never used this effect, but I seached a little bit and came accross this post: http://javascripted.me/javascript-libraries-that-will-help-you-with-parallax-scrolling.html#.UVno2ZbDOSo
They show some options to use Parallex effects, take a look.
Try using the insert like this:
INSERT INTO scores (StudentID,subjectid,classid) VALUES
SELECT DISTINCT @studentID, SubjectID, @classid FROM Scores WHERE classid= @classid
Dani, now I noticed that the JavaScript demo uses another login page when the user is not logged on.
I think that will do =)
Thanks!
Yes, It's difficult for me to login in daniweb in my Android phone, that's why I thought about the app.
Some bugs I encountered:
- Login dialog doesn't open (it just refreshs the page and doesn't open the dialog)
- Login dialog opens and closes immediately
- Login dialog opens in the middle of the screen, but since I had to zoom the page to be able to click the login button, when I zoom out, or move the screen, the dialog closes
I tested on Opera Mini, Firefox, Photon Browser and the default browser for Android. Not all bugs occurrs in all browsers.
I'm not saying that is a problem in the site, because on desktop I never had a problem. But it was not designed for mobile use.
And Dani, there's no way to do it behind the scenes that doesn't look like cross site requesting... Even if I keep an hidden browser, to keep session alive, and just fill the forms with the user input, in some way it'd still be a "bot" doing the work.
Maybe I'm missing something, but I think the only two options to do it without looking like forgery it'd be:
- Redirect to the login page (The idea that I first posted, but in that time I didn't thought that the authorization would require the login dialog, silly me)
- Login by API request (the API would have to support this with some kind of encryption)
Dani, I would use an embed browser to make the login, but I tested the site in some androids browsers and it gets buggy sometimes, so for the end user this work will be really good.
The csrf_token
is stored in the session? So I'd need to keep the session alive? Because I tried just passing one genereted csrf_token and I got the same message.
Dani, thanks, I couldn't find this page on my onw.
About doing the login behind the scenes, I was analysing the html from daniweb and tried somethings...
One of them was to post Username, Password and Referer to the members/login page, hoping it will accept and redirect to the Confirm authorization page, but instead I got an "Ooops, error occurered", problems with session message.
Can you explain to me the validations behind the login so I can make the proper use of it?
PudingEatsPanda, I'm just starting this app, and I'm starting with the login/authorization part, because it's the one the I don't have complete knowlodge about. I think using the rest of the API will be much easier.
If you have any doubts that I can help with, I'll help gladly =)
Dani, I'm gonna try make it behind the scenes, but I was testing the oAuth pages and confirmed the request, so it won't ask again for my login... there's any way to can the authorization so I can test it in my android app?
You should use css reset as pixelsoul suggest.
Also, you should have a good understanding about css box model.
In those links you'll find the basics: http://www.w3schools.com/css/css_boxmodel.asp
http://css-tricks.com/the-css-box-model/
And here you'll have more info and somethings about compability: http://coding.smashingmagazine.com/2010/06/07/the-principles-of-cross-browser-css-coding/
Oh, ok, so you'll have to use like this:
AND R.[Check-in time] BETWEEN DATEADD(hour, -R.Duration, '" & cboHour.Text & "' ) AND DateAdd(hour, -1, '" & cboHour.Text & "')
cooling,
did you try using the last line as?
AND R.[Check-in time] BETWEEN DATEADD(hour, -R.Duration, '" & cboHour.Text & "' ) AND '" & (int.Parse(cboHour.Text) - 1) & "')
Isn't this dynamic? Any propertie will be added...
You should only create a function to do it.
Or if you use jQuery use the $.extend() method: $.extend(obj1, obj2);
By associative array you mean object?
Even if you recieve an associative array from PHP it'll be transformed into a object.
You can just loop one and insert in the other, like this:
var obj1 = {
'banana': 'banana',
'apple' : 'apple'
};
var obj2 = {
'world': 'world',
'earth': 'earth'
};
// Adds all properties in obj2 into obj1
// Any property that exists in obj1 and obj2 will be overwritten.
for(var prop in obj2) {
obj1[prop] = obj2[prop];
}
Hello Reliable,
JS is much more dynamic then AS 3, I used to work with AS3 with Flex, but I didn't miss a thing when I got back with JS.
There's multiple ways to define an JS function, some of them are:
// only functions
function myFunc() {};
var myFunc = function() {};
//function inside objects
var myObj = {
prop: '',
method: function() {
}
};
myObj.method2 = function() {
};
myObj.method();
myObj.method2();
//Function prototype
var MyFunc = function() {}
MyFunc.prototype.Method = function() {};
var obj = new MyFunc();
obj.Method();
Also, there's multiple ways you can call a function in JS:
var func = function(param1, param2){
// do something
};
func('a', 'b');
func.call(func, 'a', 'b');
func.apply(func, ['a', 'b']);
// you can even create a function with no name and execute it at the moment (used to control variable scopes)
( function(param1){
// do something with param1
} ('value of param1'); )
// functions can also be passed as parameter, much used for callbacks
var func2 = function(callback) {
callback('result of something');
}
func2(function(result) {
alert(result);
});
// or you can pass the reference of the function
var func3 = function(result) {
alert(result);
};
func2(func3);
Hope you can understand something inside this mess I wrote =D
Dani, I'm planning what will be needed to acomplish this app, and my first doubt is about the login with OAuth2.
As described in the API page the app must redirect to the daniweb auth page, but the Android app will not run in a browser.
If this is the only way, I thought about the following, it's kind messy but I think it would work:
What do you think?
What does dr.Item("dob").ToString
returns?
If dr.Item("dob") is a valid date, this should work:
TempDate = new Date(dr.Item("dob").ToString("yyyy-MM-dd"))
txtDate.Text = TempDate.ToString("yyyy-MM-dd")
Take a look at the this http://msdn.microsoft.com/en-us/library/ms537509(v=vs.85).aspx
And this could be usefull as well http://stackoverflow.com/questions/280879/how-can-i-determine-which-version-of-ie-a-user-is-running-in-javascript
I'd like to make a pool to find out the most used Android OS version among Daniweb users, is there any way to do it in the forum? I couldn't find anything
Try using like this:
TempDate = dr.Item("dob").ToString
txtDate.Text = TempDate.ToString("yyyy-MM-dd")
I really never had problem with this, but I searched a little bit and this post may help you:
http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode
If my logic is correct, just update this line:
AND R.[Check-in time] BETWEEN DATEADD(hour, -R.Duration, '" & cboHour.Text & "' ) AND '" & (int.Parse(cboHour.Text) - 1) & "')
Anisha,
you could call your Handler.cs method inside the the MakeText() in Result.aspx.cs.
If you want Handler.cs to write your Result.aspx, you have to use one of the methods I suggest in my first post.
Good to know Bill.
Just mark the thread as solved please.
Good weekwend too.
Bill, it's all about CSS.
If you just want to bring the body content up, set margin-top: -10px;
. Or decresce the first heading font-size.
Oh, I didn't notice that... but your are making a lot of selects, so they can return in only one datatable.
You have to use an DataSet, like this:
SqlDataAdapter sda = new SqlDataAdapter(sc);
DataSet ds = new DataSet();
sda.Fill(dt);
And then use ds.Tables
, for each select there'll be an table.
Did you tried other browsers in your local env?
I don't have one either, but at my firm we have one for testing apps. But I was uncertain because, who knows if in another country it could have another SO, like Windows Phome in example.
Let me ask, in the actual scenario, if the user selects 13pm(and there's a reservation from 10 to 12) the facility is displayed?